Hi,
One Way:
protected void gv_RowCommand(object sender, GridViewCommandEventArgs e)
{
GridViewRow gvr = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
int RowIndex = gvr.RowIndex;
}
Second Way:
if you have built in command of gridview like insert,update delete,on row command you can following line code to get index.
int index = Convert.ToInt32(e.CommandArgument);
Third Way:
protected void OnRowCommand(object sender, GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow gvRow = GridView1.Rows[index];
}
Mark as Answer if satisfied...
Regards,
Shree M.
Kavya Shree Mandapalli
Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator