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:
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
Post a Comment