المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : DataGridViewComboBoxColumn not showing the contents



C# Programming
11-10-2009, 02:03 AM
Hi
I am trying to insert a DataGridViewComboBoxColumn, the column is getting inserted but without values (options) in the combobox.

The Code is as under


DataGridViewComboBoxColumn column = new DataGridViewComboBoxColumn();
column.HeaderText = "SELECT";
column.Name = "ItemSelect";
column.CellTemplate = new DataGridViewComboBoxCell();
column.Items.AddRange("One", "Two", "Three");
column.DropDownWidth = 160;
column.Width = 90;
column.MaxDropDownItems = 3;
column.FlatStyle = FlatStyle.Flat;
myDataViewGrid.Columns.Insert(0, column);


When I run the code, in datagridview all cells except 1st are populated properly, in first cell I see only empty combobox.
Also, after showing the value, which event should I use to get the selected value of combobox?

Please guide
Thanks in advance