Hi there,
I'm generating rows and binding it to the gridview. It works fine but for each row i'm binding text boxes and button as well. Now when the user clicks on any button of the row then the previous row value should be copied to the next row text boxes.
I'm unable to get the index value on which the user has clicked.
Please help me.
Regards,
Mzee.
Deepak VermaPosted Aug 9, 2012, 7:08 AM
Handle it on onRowCommand, like this
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Action")
{
int rowIndex = ((e.CommandSource as Button).NamingContainer as GridViewRow).RowIndex;
}
}