Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi everybody,

i am starting of the winforms

i don't know how to bind the database value to datagridviewcomboboxcolumn in datagridview.

can you any body tell me how can i bind and how can i do (CRUD) operations.

thanks in advance......................
Posted
Updated 5-Jun-12 2:32am
v5

 
Share this answer
 
Comments
U@007 5-Jun-12 6:56am    
iam asking only winforms(windows) not a wpf.
that to combobox with datagridview k
.
C#
DataGridViewComboBoxColumn dc = new DataGridViewComboboxColumn();
dc.DataSource = dt;
dc.ValueMember = "ID";
dc.TextMember = "Name";

DataGridView1.Columns.Add("ColumnName", dc);


where dt = datatable which is store the ID and Name.
Try this.
 
Share this answer
 
v2

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