I am selecting data from 2 cells in my GridView. See code blelow:
The value from Cell(0) get selected Ok, get error on Cell(5), last line in code.
Error is:
Conversion from string "" to type 'Integer' is not valid.
If I change my code to this:Code:Dim index As Integer = Convert.ToInt32(e.CommandArgument) Dim mySelectedRow As GridViewRow = GridView2.Rows(index) Dim mySelectedCell As TableCell mySelectedCell = mySelectedRow.Cells(0) Dim mySelectedDate As DateTime = CDate(mySelectedCell.Text) & " 00:00:00" mySelectedCell = mySelectedRow.Cells(5) Dim mySelectedNote As String = ToString(mySelectedCell.Text)
I do not get an error, but the value for "SelectedNote" is blank. Could this be due to the field being defined as a Button Field?Code:Dim SelectedNote As String = mySelectedCell.Text.ToString
Cell 0: 6/30/2008
Cell 1: 5101
Cell 2: Y
Cell 3: 697.66
Cell 4: TN
Cell 5: 1.5" lift 1/1 68+92-114+37 1
Fields in cells 0 - 4 are bound fields
Field 5 is a button field (click able)




Reply With Quote