Hi,
I want to add my custom UltraComboEditor in Ultrawingrid. i implemented as mentioned below.
MyUltraComboEditor myComboEditor = new MyUltraComboEditor();myComboEditor.DropDownStyle = DropDownStyle.DropDownList;
//..Getting Values and adding into the list ..
libertyComboEditor.Items.Add(new ValueListItem(kv[0], kv[1]));
ultraGrid1.DisplayLayout.Bands[0].Columns[j].EditorControl = myComboEditor;
Here, i set the DropDownStyle to DropDownList but still the cell is editable.
Moreover, I want to set the Combo value at the runtime. But i wont be able to achieve this.
public void SetComboValue(int rowno, string key, int band, string value){UltraGridRow row = this.ultraGrid1.Rows[rowno];if (row != null){UltraGridCell cell;cell = row.Cells[this.ultraGrid1.DisplayLayout.Bands[band].Columns[key]];MyUltraComboEditor myComboEditor = (MyUltraComboEditor)cell.EditorControlResolved;int t = 0;t = myComboEditor.FindString(value);myComboEditor.SelectedIndex = t;}}
I want to capture the ValueChanged event. Even that is not firing.
will anyone help me on this.
Thanks,
In this case, you should be relying more on the properties of the grid itself, not the editor. Try setting the Style on the column to DropDownList and see if that addresses your issue. As for setting the combo value on the control itself, I don't think this is going to work either since the grid column uses a clone of the editor that the control uses; the EditorControlResolved/EditorResolved properties will, in this case, return the same instance for all cells in the column, so you would be modifying them for the entire column anyway. I think that your best bet would be to set the Value of the cell directly instead.
-Matt
Thanks for the reply,
i want to expose my own properties and methods for combo box in the Ultrawingrid (say, method to cache combo values of the column) and i want to capture the event of ItemChanged to do some validations. For that reason, i have created a custom combo editor and i expose my own properties and methods. But if i set the column style to Dropdown list will i be able to acieve all the below mentioned things?
1. Capture the selecteditem change event?
2. How to change the Selected Item of the combo box at the the runtime?
3. How to change the list item at the runtime?