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
For a dropdown tree, you don't need the ControlContainerEditor. You will need to create your own editor. It's a lot easier than it sounds. This post has some sample code:
http://community.infragistics.com/forums/p/18024/65547.aspx#65547
Hi MikeSorry, I am still not sure in witch direction I have to work ...I tried to set the control for the column like this:...Bands[0].Columns["Test"].EditorComponent = (System.Windows.Forms.Control)static_MyTreeWhen I try this, I need to implement "Infragistics.Win.IProvidesEmbeddableEditor".But what do I have to implement in this property ??Or am I going the wrong way ??Thanks for your help.Best regardsFrank Uray
Did you read the link I pointed you to above? There's no tree control that is also an editor. You have to assign an EmbedableEditor to the EditorComponent property, such as an UltraTextEditor. This is explained in some detail if you follow you that link. The only thing you have to change is to use EditorComponent instead of EditorControl.
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)?