From: Moshazu on
I am attempting to use the DataGridView control in my software and have
not been able to easily find answers to a couple of questions that I

1. Is the only way to change the data in a DataGridViewComboBox during
the runtime the way that I have done it here? If not, is there an
easier way?

Dim tmpCMBRow As New DataGridViewRow
tmpCMBRow.Cells(0).Value = "New Hello"

Dim tmpCMBCell As New DataGridViewComboBoxCell
tmpCMBCell.Items.AddRange(New String() {"tmp1", "tmp2", "tmp3"})
tmpCMBRow.Cells.Insert(1, tmpCMBCell)

Me.grid.Rows.Insert(0, tmpCMBRow)

2. Once I have my information in the DataGridViewComboBoxCell, how do I
change the selected index of the information? I.E. in my example above
using the tmp tags, how would I tell the grid to display tmp2 as the
default when this cell is shown?

Any help would be great.

Thanks again all, and have a great holiday,

Pages: 1
Prev: adding combobox item data
Next: form Unload