T
TC
How do I configure a bound DataGridView to use ComboBoxes in some
columns instead of TextBoxes?
I'm using Visual Studio 2005. I have a DataGridView which is bound to
a DataTable. When I bind the grid to the table, I automatically get a
column of TextBoxes for each column in the table. I'd like some of
those columns to be columns of ComboBoxes, not columns of TextBoxes.
Unfortunately, I can't figure out how to make that happen.
I've researched the DataGridViewComboBoxColumn and
DataGridViewComboBoxCell classes, and I have no trouble creating a
column of ComboBoxes and populating the ComboBox selection list. I
understand how to add a column of ComboBoxes to a grid and I
understand how to change the CellTemplate for unbound columns.
However, I don't understand how to make a bound column use ComboBoxes
instead of TextBoxes. Can anyone point me in the right direction?
-TC
columns instead of TextBoxes?
I'm using Visual Studio 2005. I have a DataGridView which is bound to
a DataTable. When I bind the grid to the table, I automatically get a
column of TextBoxes for each column in the table. I'd like some of
those columns to be columns of ComboBoxes, not columns of TextBoxes.
Unfortunately, I can't figure out how to make that happen.
I've researched the DataGridViewComboBoxColumn and
DataGridViewComboBoxCell classes, and I have no trouble creating a
column of ComboBoxes and populating the ComboBox selection list. I
understand how to add a column of ComboBoxes to a grid and I
understand how to change the CellTemplate for unbound columns.
However, I don't understand how to make a bound column use ComboBoxes
instead of TextBoxes. Can anyone point me in the right direction?
-TC