There is no SelectedIndex property for DataGridViewComboBoxColumn

There is no SelectedIndex property for DataGridViewComboBoxColumn.

Not even .Text i ve attached dataset to the DataGridViewComboBoxColumn Like..

BindingContext objBind = new BindingContext();
comboSource.BindingContext = objBind;

comboSource.DataSource = objDS.Tables[0];
comboSource.ValueMember = strValue;
comboSource.DisplayMember = strDisplay;

But then when i wanted to select any value from the combobox runtime there is no property like SelectedIndex, SelectedValue, Text.

How can select the item from DataGridViewComboBoxColumn with passing index id




Answer this question

There is no SelectedIndex property for DataGridViewComboBoxColumn

  • ajb2607

    Hi there,

    The DataGridViewComboBoxColumn class does not expose properties or functions to select values because it represents the column....What you need to do is set the display values for the cells in the columns as the cells are what show information to the user.

    In a column of type DataGridViewComboBoxColumn, all the cells are of type DataGradiViewComboBoxCell and there are properties for the cell (e.g. Value) that allow you to set the value in the cell. Here's some doco:

    DataGridViewComboBoxCell Reference
    An example

    Hope that helps you a little bit, but sorry if it doesn't




  • CRxyz

    Thank you Very much for your reply Dear Nate...

    I tried that but this is also not working.

    Actually it is showing me that index id of that item is selected at the time of line execution in code, while debugging. But it is not showing in the combobox that value selected or any other value selected. like it has gone for a toss....

    Thank you for your suggestion, if you have any other suggestion... Please reply me.



  • There is no SelectedIndex property for DataGridViewComboBoxColumn