I have the following code ... The index was out of range was less than the non-negotiable and the size of the collection. Parameter name: index MsgBox just end up being read data that there should me to check in the day that it is a parameter so I can add DB. ..but still .. nothing. Is this the right code to read directly from a cell in a row? In the "protected sub" area, I tried the pre-selected Ink Exchanges and Row editing ... and still nothing. Still throws an error on me If I try If there is no row selected However, it is easy to access the selected row like this: Note that the cell index is zero-based.
SAFE sub GridView1_RowUpdating (ByVal as this object , ByVal e as EventArgs) handles integer as GridView1.RowUpdating dim SocioNumInfo = CInt (GridView1.Rows (GridView1.SelectedIndex) .Cells (4) .text) MsgBox (SocioNumInfo.ToString) ... End Sub
as dim SocioNumInfo string = CSTR (GridView1.Rows (GridView1.SelectedRow) .Cells (4) .text) This gives me an "integer Can not be changed "Error
GridView1 selected index to
-1 . You may have to add a check
if gridview1 Selected index & lt; & Gt; -1 then use 'GridView1.SelectedIndex ending here then
Slow Line = GridView1 SelectedRow row is not IsNumeric nothing andalso (row.Cells (2) .text) then dim SocioNumInfo Integer = CInt (row.Cells (2) as .text) .... Finally, if
row.Cells (4) is in the 5th column.
Friday, 15 February 2013
asp.net - Datagrid row not being read code -
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment