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
Loading
Ruthwik JDPosted Apr 28, 2015, 3:22 AM
In case you got the code for above Question....Please post the code...
Regards,
Ruthwik
Renjith RPosted Feb 2, 2015, 5:29 AM
Saber ShaikhPosted Feb 2, 2015, 5:21 AM
explain your question