I Have to bind a comboBox to a datagridview in a windows form application. i have used the below code.
DataGridViewComboBoxColumn cmb = new DataGridViewComboBoxColumn();
cmb.HeaderText = "Installation";
cmb.Name = "cmb";
cmb.MaxDropDownItems = 3;
cmb.Items.Add("--SELECT--");
cmb.Items.Add("Pre-Installation");
cmb.Items.Add("Installation");
cmb.Items.Add("Post-Installation");
By using the this code comboBox is binded in gridview, But it is displaying on the topside of the column, I need to display the comboBox to the center of the column and
--Select-- should display by default.
For displaying comboBox to center i have used this
cmb.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
Thanks in advance
How to bind ComboBox to a datagridview in a windows form
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Saber ShaikhRank #1,687 · 905 reputationPosted Feb 2, 2015, 12:21 AM EST
explain your question
Renjith R14 reputationPosted Feb 2, 2015, 12:29 AM EST
Ruthwik JD17 reputationPosted Apr 27, 2015, 11:22 PM EDT
In case you got the code for above Question....Please post the code...
Regards,
Ruthwik