in gridview there are some linkbutton and butoon whose visible property is currently false...
i want it get visible when it meet some specicified conditions......
but my problem is how to set the property of these button visible=true....
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dipa AhujaPosted Jun 2, 2010, 8:49 AM
Deepak PandeyPosted Jun 2, 2010, 7:59 AM
i tried your code it is not working.........
when i tried to true the visible property of link button it throws an exception...
plz try to give proper solution of my proble.....
CrishPosted Jun 1, 2010, 1:36 AM
in gridview there are one event RowDatabound. It uses for finding each and every row data bound in grid. You can find your linkbutton and button over there.
In rowdatabound write below code
Linkbutton lnkbutton = (Linkbutton)e.item.Findcontrol("linkbutton");
you can find this control value and you can set visible true or false accordingly as per your requirement.
Don't forget to Mark Do you like this Answer
that solved your problem!
Charith LiyanagamagePosted May 31, 2010, 11:54 PM
You can use below commands to enable select/edit/delete buttons of the gridview at any condition point.
if(xxxxxxx)
{
//enable Select button
GridView1.AutoGenerateSelectButton = true;
//enable Edit button
GridView1.AutoGenerateEditButton = true;
//enable delete button
GridView1.AutoGenerateDeleteButton = true;
}