Hi allI am using "NetAdvantage 2009.2" and I am tryingto add a TreeView to a column.Does anybody know how to add a TreeView Controlto a UltraGrid Column ?The treeview is instanced and loaded. On the treeviewclick, the selected node as text will be returned into the cell value.Thanks for any help .Best regardsFrank Uray
The UltraCombo only contains a single flat list of items. So you would need to populate it with a single list that includes all levels of the tree. Of course, if there are duplicates, then this approach will not work. But then again... if there are duplicates, what you are trying to do will not be possible, since the grid can only store a single value.
Thanks Mike, I'll try the first option first, and see how it goes. I am assuming, that the combo listitem is going to have to have the folders (parent nodes) as well as the regular nodes (items) for the translation to work properly, or will the combo recognize the difference?
Hi James,
Well... there's no editor that will do that for you automatically.
There are a few approaches you could take.
Presumably, you are using UltraTextEditor with a DropDownEditorButton. You could use UltraCombo instead of UltraTextEditor. You would just hide the "real" dropdown button and add a DropDownEditorButton like you are doing now. The down side is that you need to fill two lists: the tree and the UltraCombo's ListItems collection with the same values. The up side is that the UltraCombo would take care of the translation for you.
Another approach is the unbound column approach you mentioned.
A third approach would be to use a DataFilter. The DataFilter gives you the opportunity to translate the value from display to editor and vice versa. So the editor would store the value, but you would translate the display to some text and then you would do the reverse in the DisplayToEditor transition. This is basically exactly the same as using an unbound column - you still have to do the translation yourself. It just removes the complexity of the extra column.
correct...the tree key contains the id (int) of the item, so the column in the grid would be that (int) in the databinding..so when a user selects a node on the tree in the dropdown, it will populate that integer, while displaying the node's text. Wile I could probably do it the long way with an undatabound column, and then loop through the nodes, I'd basically like the valuelist to be the tree
I'm not exactly clear on what you want. You want a dropdown tree in a grid call that also handles converting a value into display text and vice versa (like the ValueList does)?