doddwell
asked on
DatagridView ComboBox Column As Integer
Hello
I have a bound DataGridView with an integer column called TenantShare. I can add data to it without any problmes if I leave the column as a textbox. I want the column to be a combobox so I changed the ColumnType property to DataGridViewComboBoxColumn and gave the combobox sme values (0, 50, 100).
When I run the form and try to add data, I get an error saying Value Not Valid. I think this is because the items I added to the combobox are being stored as strings - but I don't know how to add them as Integers
Thanks, Simon
I have a bound DataGridView with an integer column called TenantShare. I can add data to it without any problmes if I leave the column as a textbox. I want the column to be a combobox so I changed the ColumnType property to DataGridViewComboBoxColumn
When I run the form and try to add data, I get an error saying Value Not Valid. I think this is because the items I added to the combobox are being stored as strings - but I don't know how to add them as Integers
Thanks, Simon
How do you bind the values to the DataGridViewComboBoxColumn ? You should be able to bind to a list of integers, but I am not sure that it will help you with the other parts of the DataGridView...
ASKER
To bind values you do this (Visiual Studio 2010):
Click on DataGridViewTasks
Edit Columns
Choose the column you want and chnage the ColumnType to ComboBox
How can I bind a list of integers?
Thanks.
Click on DataGridViewTasks
Edit Columns
Choose the column you want and chnage the ColumnType to ComboBox
How can I bind a list of integers?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.