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


Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Aug 4, 2011, 4:12 AM EDT
check the conditions
if (index < MyGridView.Rows.Count)
{
//action
}
refer this Thread
Smart LuckyRank #2,625 · 531 reputationPosted Aug 4, 2011, 8:51 PM EDT
Can you send me an example....?