here my code, but all in edit column enabled false, i want false editbutton depend on statuse value
foreach (GridViewRow row in GridView1.Rows)
{
statuse = dt.Rows[0].ItemArray[6].ToString();
if (statuse != null || statuse != "")
{
if (control is LinkButton)
{
LinkButton btn = control as LinkButton;
btn.Enabled = btn.CommandName.Equals("Edit");
btn.Enabled = false;
}
}
}
This is how it's usually done in the RowDataBound event.
UPDATE
If the edit button is generated automatically, you have to find the LinkButton based on Column index.