When i am click on update button i got this error my update click event
protected void btnUpdate_Click(object sender, CommandEventArgs e)
{
int idx = Conve
How many rows do you have?
Try this:
int idx = Convert.ToInt32(e.CommandArgument);
if (idx < gvResTasks.Rows.Count)
{
GridViewRow gr = gvResTasks.Rows[idx];
}
Also, can you provide the btnUpdate ASPX code?
No need to use e.CommandArgument
to find the GridViewRow
. Just do this
GridViewRow gr = ((Button)sender).NamingContainer as GridViewRow;