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
Hi Frank,
Do you want the tree inside the cell? Or do you want a dropdown in the cell that displays the tree?
If you want a tree inside each cell, then you should check out the samples for the new UltraControlContainerEditor.
Hi MikeThank you for your answer.Well, the tree should be in the dropdown.Can you give me a hint where to find the UltraControlContainerEditor ?Thanks and best regardsFrank Uray
Hi,
dipankar kumar said:Hi I want the same control to implement in vs2010. Its a request please share the code or give the correct step so i can also use the control. Its very urgent. So request you please suggest asap.
I don't understand what you are asking for. The sample posted by Boris above is a VS2010 sample.
I'd like to expand on this idea, and ask if there is a way to do this as a valuelist. Basically I'd like to use the node.key as the value and the node text as the visible column text for the grid. How would I go about implementing that?
Hi James,
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)?
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
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.
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?