Smart    Lucky

Smart Lucky

  • NA
  • 555
  • 628.3k

GridView

Aug 4 2011 2:45 AM
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)