datagrid combobox column
-
hi i have added a combobox column to my datagrid and i want to populate it with integer list.how can i set data type of this column to hold integer values.
-
hi i have added a combobox column to my datagrid and i want to populate it with integer list.how can i set data type of this column to hold integer values.
I understand you have set the DataSource of the DataGridViewComboBoxColumn, as well as its DisplayMember and ValueMember properties. When you have done so, just set the ValueType property of it, like so:
((DataGridViewComboBoxColumn)dataGridView1.Columns[2]).ValueType = typeof(Int32);
Obviously, changing the name of
dataGridView1
to your datagridview's name and the index (in this instance: 2) to the index of your combobox column. Hope it helps.var question = (_2b || !(_2b));