Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I HAVE ONE TABLE in the database .
Table name is DCD
SNO RNO VALUE
1 1 A
1 2 B
1 3 C

and a datagrid view name as DB1

Sir I create a datatable rt that have rno and value .
and the dataset name is ds.


Now sir i want to fill all the values in the datagrid view combobox type coloumn withe the values of the Value Field of DCD table.


Help me regarding this
Posted

Try something like:
C#
DataGridViewComboBoxCell cbCell = (DataGridViewComboBoxCell)myDataGrid.Rows[0].Cells[2];
cbCell.Items.Add(.....);

Refer: MSDN: DataGridViewComboBoxCell[^] and MSDN: DataGridViewComboBoxCell.Items[^] property.

Sample: Host a combo box column within a DataGridView control [^]
A short tutorial here using different approach: Binding DataGridView ComboBox Column [^]


Try out. Post specific issue if you face.
 
Share this answer
 
sir

i take the values from database.
so i want to know how the datagrid view combobox type coloumn fill throgh my datatable .
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900