You can do in different way of code.
1. Get the status value from the database as True/False as per your logic.Then inside item template of gridview add one button and in its visible properties you can directly set the status value by the help of "Eval"
Ex:
<asp:GridView ID="gv" runat="server" AutoGenerateColumns="False"
Width="486px" >
<columns>
<asp:TemplateField HeaderText="Show Button">
<itemtemplate>
<asp:Button runat="server" Visible='<%# Eval("Status") %>' Text="ButtonName" >
2. You can use the grid view gv_RowDataBound method.
Inside this grid view bind the status value in a hidden field by the help of item template.Then find the hidden field value from
gv_RowDataBound
method and as per the status show the button.
Ex:
protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
foreach (GridViewRow rowInfo in gv.Rows)
{
HiddenField hfFProductId = (HiddenField)rowInfo.FindControl("hdfId");
Button buttonID = (Button)rowInfo.FindControl("buttonID");
if (hfFProductId=="Open") buttonID.Visible=true;
else buttonID.Visible=false;
}
}
Check this code it may help you.
Happy coding..