/////////////// Some methods are below-
1. Using Gridview RowCreated Methode
2. Using Gridview OnRowDataboud method
3. Using For or Foreach loop
1. Using Gridview RowCreated Methode
protected void
Gridview_RowCreated(object sender, GridViewRowEventArgs e)
{
LinkButton ControlID = (LinkButton)e.Row.Cells[0].FindControl("ControlID");
if (ControlID != null)
{
ScriptManager.GetCurrent(this).RegisterPostBackControl(ControlID);
}
}
2. Using Gridview OnRowDataboud method
protected void
Gridview_Rowdatabound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
ImageButton ControlID = e.Row.FindControl("ControlID") as
ImageButton;
ScriptManager.GetCurrent(this).RegisterPostBackControl(ControlID);
}
}
3. Using For or Foreach loop
private void
Assign_PostBackControl(GridView Grd)
{
foreach (GridViewRow
row in Grd.Rows)
{
LinkButton lnkFull = row.FindControl("ControlID") as
LinkButton;
ScriptManager.GetCurrent(this).RegisterPostBackControl(lnkFull);
}
}