How to Populate Data with DataGridViewComboBoxColumn from database
Hi Experts...Am developing windows application..I want to insert one DataGridViewComboBoxColumn to DataGridView control at design time, and access it and populate data with it at run time..Please Help me out..Thanks in advance..
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Zoran HorvatRank #792 · 2.9K reputationPosted Jul 20, 2011, 12:50 AM EDT
You can read data from the database into DataTable object - just use the DbCommand to populate the DataTable. Then set this DataTable object to DataGridViewComboBoxColumn's DataSource property and that will populate the column.
Zoran
Amit ChoudharyRank #145 · 15.8K reputationPosted Jul 20, 2011, 1:03 AM EDT
set the properties with following values
DataPropertyName = "Category"
DataSource = CategoryBindingSource
DisplayName = "Name"
ValueMemeber = (blank)
Hope this helps you.
Thanks.