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

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -