On Tue, 06 Jun 2006 08:08:01 -0700, Mike P <mi*******@gmail.com>
wrote:
Is it possible to make an editable gridview so that certain rows are
editable and other are not editable, dependent upon a value in one of
the rows columns?
*** Sent via Developersdex http://www.developersdex.com ***
I would suggest converting the command to a template so you can access
the link button. Then in your rowcreated event do something like
this.
protected void GridView1_RowCreated(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
int id = (int) DataBinder.Eval(e.Row.DataItem, "id");
if (id > 1)
{
LinkButton lb = (LinkButton)
e.Row.FindControl("LinkButton1");
lb.Visible = false;
}
}
}
Peter Kellner
http://peterkellner.net