I have a gridview with text boxs and two LinkButton Up and Down, I want to make the LinkButton Up and down as Disable, The condition is, Linkbutton Up must be disable for the first row and Linkbutton Down must be disable for the last row.
I am trying to do in onRowDataBound.. But I am unable to do..
foreach (GridViewRow row in GridView1.Rows)
{
// some code?
}
Please some one tell me how to do that.. with some test exp.
I wouldn’t do it in the OnRowDataBound event, I would disable the controls after the GridView has been bound:
You could use either the FindControl method or just directly index the controls.