Tuesday, October 6, 2009

To get the Grid Edit Index from a Template column Event

protected void imgButton_Click(object sender, ImageClickEventArgs e)
{
ImageButton imgBtn = (ImageButton)sender;
GridViewRow row = (GridViewRow)imgBtn.NamingContainer;
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "Selected Index Is: " + grdRequests.Rows[row.RowIndex].Cells[1].Text.ToString() + ", true);
}

No comments:

Post a Comment