I create UltraComboEditor in my control's constructor:
_comboEditor = new UltraComboEditor(); _comboEditor.DropDownStyle = DropDownStyle.DropDownList;
and assign it to the column in UltraGrid.OnInitializeLayout:
column.EditorControl = _comboEditor;
But when the editor is shown, it still allows typing in the text even though I did explicitly set DropDownStyle = DropDownStyle.DropDownList (see above). If I modify other properties of the editor, they work fine (for example button alignment).
Any idea why it still allows typing in arbitrary values?
Found it! Sorry...
uiColumn.Style = ColumnStyle.DropDownList;
Sorry, I found now that the UltraGridComboColumn has such property...
But my columns are generated automatically from the UltraDataSource (data bound), therefore they are all just UltraGridColumns...
Do you have any other ideas on what I could do?
Hi Mike, thanks for your reply!
I am looking at the UltraGridColumn class and I don't see the DropDownStyle property; I also cannot find such property in the UltraGrid class.
Could you please be more specific?
The reason is that the grid already has a property that controls the dropdown style, so the grid setting override the editor setting. You need to set the Style property of the column to DropDownList.