Click here to Skip to main content
15,125,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am Using a Gridview to display different values from database, and i have a link buttons in the gridview as a column,
but i need how to enable and disable linkbuttons of some rows inside the gridview on PageLoad.
Posted

1 solution

DataTable dt = new DataTable(); 
dt.Load(reader);//reader is the sql data reader having db values
grdHold.DataSource = dt; grdHold.DataBind();
if (grdHold.Rows.Count >= 1)
{
  if (gvr.Cells[6].Text = "")
  {
        ((LinkButton)gvr.Cells[4].FindControl("lblHold")).Enabled=False;                   
  }

}
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900