[C#] Fill Datagridview with combobox

Jelmer

Regular
Joined
Jan 11, 2006
Messages
96
Hello

I've made a form with a datagridview and 1 column configured as a combobox.
I like to fill the combobox on the load of the program... But how can i reach the combobox ?

combobox3.columns[3].Items.Add("item"); ?

Something like that.. but i cant find it..
 
Hi,

This does what you need/want


DataGridViewComboBoxColumn cln_cmb_birthay;
cln_cmb_birthay = new DataGridViewComboBoxColumn();
cln_cmb_birthay.DataPropertyName = "Names";
cln_cmb_birthay.DataSource = myDataTable;
cln_cmb_birthay.DisplayMember = "Names";
cln_cmb_birthay.HeaderText = "Choose Names";
cln_cmb_birthay.Name = "cln_cmb_birthay";

.eof

Teixeira
 
Back
Top