HI anbujeremiah,
This is a link that can help you in finding your solution please have a look into it.
Access buttons in Code behind
First of all add the button to your grid as following code snippet:
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID = "lnkSil" runat="server" CommandName="bla"
CommandArgument='<%# ((GridViewRow) Container).RowIndex %>' Text= "Sil" ></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
Then add a row data bound function that can able to access the control. Follow the below code snippet.
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int currentRowIndex = Int32.Parse(e.CommandArgument.ToString());
LinkButton bf = (LinkButton)gv.Rows[currentRowIndex].Cells[1].Controls[0];
...
}
Thanks & Regards
sisir