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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Charith Liyanagamage112 reputationPosted May 31, 2010, 7:54 PM EDT
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;
}
CrishRank #1,487 · 1.1K reputationPosted May 31, 2010, 9:36 PM EDT
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!
Deepak Pandey71 reputationPosted Jun 2, 2010, 3:59 AM EDT
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.....
Dipa AhujaRank #1,168 · 1.5K reputationPosted Jun 2, 2010, 4:49 AM EDT