DataGridView Control .NET 2.0
-
Hi all, I'm really struggling to do something very simple using a DataGridView control. I'm setting the DataGridView DataSource to an existing DataSet. All the data is displayed fine. I now want to select a range of cells using the DataGridView, and when I click a button, have the selected cells copied to a new (previously empty) dataset. I just can't figure out how to get the data I've selected in the DataGridView control into the new dataset. By putting a watch on the DataGridView control, I can see the list of items contained in the control, but they're all non-public so I have no way of getting at them programmatically. Any assistance would be very much appreciated.
-
Hi all, I'm really struggling to do something very simple using a DataGridView control. I'm setting the DataGridView DataSource to an existing DataSet. All the data is displayed fine. I now want to select a range of cells using the DataGridView, and when I click a button, have the selected cells copied to a new (previously empty) dataset. I just can't figure out how to get the data I've selected in the DataGridView control into the new dataset. By putting a watch on the DataGridView control, I can see the list of items contained in the control, but they're all non-public so I have no way of getting at them programmatically. Any assistance would be very much appreciated.
I don't know if I have understood the question right but you can access the cells with [code] dataGridView1.Rows[0].Cells[1].Value; [\code] hope this helps
-
Hi all, I'm really struggling to do something very simple using a DataGridView control. I'm setting the DataGridView DataSource to an existing DataSet. All the data is displayed fine. I now want to select a range of cells using the DataGridView, and when I click a button, have the selected cells copied to a new (previously empty) dataset. I just can't figure out how to get the data I've selected in the DataGridView control into the new dataset. By putting a watch on the DataGridView control, I can see the list of items contained in the control, but they're all non-public so I have no way of getting at them programmatically. Any assistance would be very much appreciated.