Databind to the tree control within the drop down in the Grid Template column

Posted by: naomi722 on 7 August 2017, 4:22 pm EST

  • Posted 7 August 2017, 4:22 pm EST

    Hello,

    I’m trying to use the hierarchical drop down list within the DataGrid. I’m referencing the DropDown control demo which has the treevew control in it (C1_Demo2008C1DropDownDemoDropDown.xaml and DemoDropDown.xaml.cs). Now, I’m trying to put that drop down control that contains tree view in the DataGrid template column.

    My question is how can I databind to the treeview control? If the drop down/treeview is not in the DataGrid, I could reference the control when the data is available and set the ItemsSource with the collection (as it is done in the demo). However, when the dropdown/treeview is in the DataGrid, I can no longer reference the control. If there is a good event I can trap for data binding? If you could provide me any pointers as to how to proceed, I would greatly appreciate it. By the way, I’m not autogenerating columns.

    This is what the xaml looks like:

  • Posted 7 August 2017, 4:22 pm EST

    Hi Naomi,

    I think TemplateColumn is not enough for you. Create a custom column, where you can access the treeview programmatically.

  • Posted 7 August 2017, 4:22 pm EST

    Hi Naomi,

    Do you need further guidance or was it enough for you to make it work?

    Regards

  • Posted 7 August 2017, 4:22 pm EST

    Yes. I would appreciate further guidance. Thank you so much in advance for all your help.

    By the way, I was having trouble binding to the text property of the textblock control (within the header, content control) as well. Perhaps, I may not need to be worried once I work with custom column…..

    Regards,

    Naomi

  • Posted 7 August 2017, 4:22 pm EST

    Hi Naomi,

    I am not sure about the binding problems you had. Difficult to say from your description.

    --

    Please take a look to the documentation (helpcentral.componentone.com/.../c1silverlight), under Components and Controls > DataGrid > Working with DataGrid for Silverlight > Creating Custom Columns.

    That would be a good overview of what you need to take into account when creating custom columns (like recycling, etc).

    Then, you can find simple samples of custom columns in demo.componentone.com/.../controlexplorer

    (The link to the sample code in your computer is in the "info" tab)

    For your specific scenario, you might also need to add custom properties for your specific column (as we do for example in the ComboBoxColumn, with the ItemsSource property). In the GetCellEditingContent override you can bind the column.ItemsSource to the TreeView instance's ItemsSource.

    Regards

  • Posted 7 August 2017, 4:22 pm EST

    Hi Naomi,

    Here's a small sample with a custom column with a preview. I hope you can use it as a starting point for your program.

    Regards,

    Bruno

    2010/07/235340_TreeDataGrid.zip
  • Posted 10 December 2020, 2:49 am EST

    I’m trying to implement drodowntree control in my angular application but I’m unable to implement it because it is in pure js, please help me with how to implement dropdown tree view in angular is there any import is there in wijmo?

  • Posted 17 December 2020, 1:09 am EST

    This is a duplicate of the following thread:

    https://www.grapecity.com/forums/wijmo/dropdowntree-control_1

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels