Requirement :
A dropdown containing a TreeView in the cells in a column in an UltraGrid. The cells in the column are not supposed to be directly editable and should only get its values set when a node in the "TreeViewDropDown" is selected.
( So more or less the same requirement for the cell as if we put a valuelist there and set the Style property of the column to DropDownList.).
Situation :
Ive setup the grid with one of its column having its EditorContol pointing at a UltraTextEditor - which have a DropDownEditorButton in its ButtonRight collection - which again points at a UltraTree. The UltraTree is filled with UltraTreeNodes conintaining data I want passed to the grid cell. So far so good everything works fine.
Question :
Is it possible to make the grid cell non editable with this kind of functionality setup. The cells in the given column needs to be "locked" or made uneditable for direct input. The Cells should always and only get its value fra a select operation in the given custom control.
I've tried playing around with the CellActivation and CellDisplayStyle and Style properties of the grid column but without luck. If I lock the cells for editing by setting CellActivation = Activation.NoEdit; then my "dropdown"/custom control dissapears and im unable to trigger it.
Are there any straightforward way of solve this without having turn to mouseclick events or other "workarounds" ?
Thank you.
ojohnsen said:Tried changing from UltraTextEditor to UltraComboEditor and that works and gives the wanted effect if the Style is set to DropDownList. However, when I now click the cell the "empty" drop down of the UltraComboEditor appears. So I need to find the right event to cancel that or the right property to turn that off.
Try the BeforeCellListDropDown event of the grid.
Tried changing from UltraTextEditor to UltraComboEditor and that works and gives the wanted effect if the Style is set to DropDownList. However, when I now click the cell the "empty" drop down of the UltraComboEditor appears. So I need to find the right event to cancel that or the right property to turn that off.
Edit : This doesnt seem trivial since every single event i can find and hookup to doesnt seem to trigger at all. I now have tried all i can find that seems relevant and none triggers. I know it is the UltraComboEditor's "empty" list that drops down when i click the cell ( since if i fill it with a value i get that value shown), however it doesnt seem as the UltraComboEditor's events respond at all. ( BeforeDropDown, AfterDropDown, Click, BeforeEnterEditMode, AfterEnterEditMode, Enter.... )
I also tried avoiding getting into edit mode in the cells by canceling the BeforeEnterEditMode event of the cells in the grid. This however makes the dropdown button unresposive. So im getting close to stuck here now.
It really puzzles me that the UltraComboEditors events does not trigger. It renders more or less the whole approach worthless.
Any ideas ?
I don't think there's any easy way to do this.
Try setting the colmun's Style to DropDownList and see if that helps.
If not, it might be because the UltraTextEditor can't handle this style. In that case, try using an UltraComboEditor instead of an UltraTextEditor. You would have to hide the built-in dropdown button and replace it with your EditorDropDownButton.