CB
Clay Burch
Syncfusion Team
September 12, 2002 07:51 AM UTC
Normally, Essential Grid uses the same combobox for all cells with celltype COmboBox in a grid. Then as you move from one combobox cell to another combobox cell, the choicelist (or DataSource depending upon which you are using) is swapped out to reflect the settings of a new cell. The problem you are seeing is when you try to swap a combobox cell using a choicelist with a combobox cell using a DataSource. As you see, this does not work.
But the solution is simple. Just have two combobox cell models, one for choicelists and one for DataSources. You use the GridControl.CellModels.Add method to add this second celltype. For example in your code, if before you try to setup column 2, you add
this.gridControl1.CellModels.Add("ComboBoxDS", new GridComboBoxCellModel(this.gridControl1.Model));
this registers a new celltype named ComboBoxDS that is just another combobox cell. You can then use ComboBoxDS as the celltype for column 2, and I think the problem you are seeing goes away.
One last comment. You can use the same comboboxes for different choicelists. So, for example if you add a col 3 that is similar to your col 1, but with a different string collection but the same ComboBox celltype, everything would work OK. Or, if you add another ComboBoxDS column but with a different DataSource, everything would be OK. The problem is trying to mix using choicelists and Datasource in a single combobox.
HG
Harvey Green
September 12, 2002 10:19 PM UTC
Hi Clay,
Thanks for that - it works fine now...
it would be good if this was mentioned in the user guide section on combo boxes
Regards,
Harvey