3

I have a gridcontrol which is populated from database like this:

OracleConnection connection= new OracleConnection("DATA SOURCE=mydb;PASSWORD=pass;PERSIST SECURITY INFO=True;USER ID=id");
connection.Open();
OracleDataAdapter adapter = new OracleDataAdapter("select * from mytable", connection);
DataTable datatable= new DataTable();
adapter.Fill(datatable);
adapter.Dispose();
connection.Close();
gridControl1.ItemsSource = datatable.DefaultView;

Then , I change the type of gridcolumns like this:

GridColumn colCOMBOBOX = gridControl1.Columns["COMBO_MULTISELECTION"]; 
ComboBoxEditSettings combo = new ComboBoxEditSettings();
combo.StyleSettings = new CheckedComboBoxStyleSettings();
combo.ItemsSource = datatable;
combo.DisplayMember = "PERSON";
combo.ValueMember = "COMBO_MULTISELECTION";
colCOMBOBOX.EditSettings = combo;

I have a multiselection combobox in my gridcolumn. Each item from combobox has an id. My problem is : after I select multiple items, I get the error: object must implement iconvertible. So, I made a list that gets the data from database and also I made it Iconvertible. But the error still remains. Everything goes perfect with a combobox that is outside of gridcontrol.Doesn't gridcontrol supports this? How can I solve the problem?

Viva
  • 1,983
  • 5
  • 26
  • 38
  • 1
    Have you tried this https://www.devexpress.com/Support/Center/Question/Details/B132298 ? – Prokurors May 15 '15 at 15:34
  • Hi. Yes , it was something like this. I remember that my list was of type object , which couldn't be converted to String. Thank you! – Viva May 15 '15 at 16:11
  • Put it as answer . This issue is often encountered. – Viva May 15 '15 at 16:13

1 Answers1

1

The problem appears because the type of the value returned by the LookupEdit differs from the type of the data field of the grid column

You can read detailed information about this here -> DevExpress support ticket

Prokurors
  • 2,458
  • 3
  • 40
  • 65