Put this code in your gridview row data bound
c#
DataRowView drv = (DataRowView)e.Row.DataItem;
string catName = Convert.ToString(drv["YorColumnName"]);
if (catName == "1") {
Button btn = (Button)e.Row.FindControl("btnAccept");
btn.Visible = false;
}
vb
Dim drv As DataRowView = DirectCast(e.Row.DataItem, DataRowView)
Dim catName As String = Convert.ToString(drv("YorColumnName"))
If catName = "1" Then
Dim btn As Button = DirectCast(e.Row.FindControl("btnAccept"), Button)
btn.Visible = False
End If
Note :Do not use cell[0], cell[1] etc, instead use the column names to retrieve the data you want.
---------------------------------------
Live the life you've dreamed
Regards
MADHU
Kavi.Sirius, if this helps please login to Mark As Answer. |
Reply | Alert Moderator