2
Answers

GridView

Smart    Lucky

Smart Lucky

13y
1.2k
1
Hi

hi i am trying to print edited colum values in this way it is giving me excetopn can any one tell me why exception is occured and how i henadel it....?



        TextBox txtid = (TextBox)GridView2.Rows[grv.RowIndex].Cells[4].Controls[1];//
Excetion is Occured here Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
        TextBox txtname = (TextBox)GridView2.Rows[grv.RowIndex].Cells[4].Controls[1];
        TextBox txtempid = (TextBox)GridView2.Rows[grv.RowIndex].Cells[5].Controls[1];
        Response.Write("ID is" + txtid.Text );//+ "Name is" + txtname.Text + "Emp id" + txtempid.Text);




Answers (2)