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 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.
Hi MikeYes, I have read the link but sorry, now I am quite lost ...In this link, there is all about button and editors, nothing about tree's ...Can you tell me:- Is it possible to have a treeview in the dropdown of a UltraGrid Cell ?- If yes, can you give me an idea of how to do ?The idea would be, after a node is selected, the selected text is the value of the cell.Thanks a lot and best regardsFrank Uray
The link describes how you use an editor (an UltraTextEditor is used in the example) to place a dropdown button in a grid cell that has a control on it. The control you place on the dropdown can be anything you want - in your case, you want a tree control.
Hi MikeDo I understand right, I have to create a DropDownEditorButton and placemy control (treeview) on it ? Like this ?DropDownEditorButton button = new DropDownEditorButton();button.Control = MyTreeView;But how do I tell the Grid column to use this button (TreeView) ?DisplayLayout.Bands[0].Columns["Test"].??When I use .Editor I get a conversion exception:"Cannot implicitly convert type 'Infragistics.Win.UltraWinEditors.DropDownEditorButton' to 'Infragistics.Win.EmbeddableEditorBase'"Can you give me some more help on that ?Thanks and 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)?