Below is the reference code of one way to achieve this.
<asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound"
Height="100px">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Button ID="btn1" runat="server" Text="Approve" CommandArgument= />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void Page_Load(object sender, EventArgs e)
{
string [] dataSource = { "3","1", "2" };
if (!IsPostBack)
{
GridView1.DataSource = dataSource;
GridView1.DataBind();
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.DataItem.ToString() == "1")
{
var cont = e.Row.FindControl("btn1");
e.Row.Cells[0].Controls.Remove(cont);
e.Row.Cells[0].Text = "Not Approved";
}
}
}