Hi
Trying to use a DataGridView like the old VB6 FlexGrid, and add the coloumns manually via addrow (built a Row containing TextCells) and my Coloums are all added (and display ok) but as soon as I try to add a row I get the message "Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound." But for love nore god can I see a way of setting it as a unbound control (I've not set the datasourc to anything)
So two questions really,
- is there a better control to use ?
- is there way to set a DataGridView to be an unbound control
And a final third question
- How do you add row manually ?
Snippet of how I've done it do far
Thanks in advance
Dim lRow As New DataGridViewRow
Dim lCell As New DataGridViewTextBoxCell
lCell.Value = "Cell 1"
lRow.Cells.Add(lCell)
lCell = DataGridViewTextBoxCell
lCell.Value = "Cell 2"
lRow.Cells.Add(lCell)
DataGridView1.Rows.Add(lRow)