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.
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);

Smart LuckyPosted Aug 5, 2011, 12:51 AM
Can you send me an example....?
Jiteendra SampathiraoPosted Aug 4, 2011, 8:12 AM
check the conditions
if (index < MyGridView.Rows.Count)
{
//action
}
refer this Thread