Hi all,
I have just made a move into Visual Studio 2005 and am having a few problems when trying to copy data in a datagridview and displaying each row in a listbox. It's only the data in the first column that I need copied and the datatype is 'double'.
Here is the code that I have written to do this:
Dim row As Integer
For row = 0 To <datagrid>.Rows.Count - 1
Dim cellvalue As Object = Me.<datagrid>.(0, row)
Me.<listbox>.Items.Add(cellvalue.ToString)
Next row
This however does not display the data correctly. Instead of displaying the value in the listbox, the following appears:
DatagridViewTextBoxCell{ColumnIndex=0, RowIndex=0}
Can anyone point me in the right direction as to why this is not displaying correctly. I have been going around in circles for two days now!
Ross.
I have just made a move into Visual Studio 2005 and am having a few problems when trying to copy data in a datagridview and displaying each row in a listbox. It's only the data in the first column that I need copied and the datatype is 'double'.
Here is the code that I have written to do this:
Dim row As Integer
For row = 0 To <datagrid>.Rows.Count - 1
Dim cellvalue As Object = Me.<datagrid>.(0, row)
Me.<listbox>.Items.Add(cellvalue.ToString)
Next row
This however does not display the data correctly. Instead of displaying the value in the listbox, the following appears:
DatagridViewTextBoxCell{ColumnIndex=0, RowIndex=0}
Can anyone point me in the right direction as to why this is not displaying correctly. I have been going around in circles for two days now!
Ross.