Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1075
How to display TreeView instead of ValueList
posted

 Hi!

I have UltraGrid with some IDs in it. Now I am using ValueList to Display/Edit  those IDs.

e.Layout.Bands["Weights"].Columns["FoodTypeID"].ValueList = this.gridViewWaste.DisplayLayout.ValueLists["FoodNames"];

User wish to see Tree instead of plain list because he has too many FoodTypes and because on other forms we are using UserControl which displays FoodNames like a TreeView. How can I do so grid still displays Names instead of IDs and when user enter edit mode it shows him Tree?

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

     Hi,

    There's no built-in dropdown tree control. But you can make your own and it's pretty easy. 

    Start with an UltraTree (or an Inbox tree or whatever control you prefer) and an UltraTextEditor control. 

    Use the ButtonsRight collection on the UltraTextEditor and add an EditorDropDownButton to it. 

    Set the EditorDropDownButton's Control property to the UltraTree. 

    Set the grid column's EditorControl property to the UltraTextEditor. 

    That's it, you now have a dropdown tree control in the grid. You will, of course, have to handle what happens when the user clicks on a node in the tree and set the grid's ActiveCell.Value to the value you want based on the node they clicked. You might also want to handle the AfterEditorButtonDropDown event on the UltraTextEditor to select the appropriate item on the tree when the user drops it down. 

Children