c# - How to disable a cell of a GridView row? -


i have gridview control first 2 columns have buttons. when row being created, want check if sixth column text "locked" or not. if yes button in first cell should not visible.

the first 2 columns of gridview looks this:

enter image description here

you need below hinde button control form cell...

protected void gridview1_databound(object sender, gridviewroweventargs e)     {         if (e.row.rowtype == datacontrolrowtype.datarow)         {             if (e.row.cells[5].text=="locked")             {                 (e.row.findcontrol("idofbutton1") button).visible=false;             }         }     } 

Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -