C1TreeViewItem

Posted by: phiiii on 7 August 2017, 5:49 pm EST

  • Posted 7 August 2017, 5:49 pm EST

    Good afternoon.

    I'm having a hard time creating a menu using the C1TreeView component and C1TreeViewItem.

    I have a menu with three levels of hierarchy, where each item in my menu contains an image.
    But these items are returned from a query made in the database and to load that my c1TreeView I use foreach, however this is now causing me some problems as there are database with more than 4000 records.

    Is there any more agile way to do this?

    Any example where this C1treeView is loaded dynamically with images?

    Thank you very much in advance.
  • Replied 7 August 2017, 5:49 pm EST

    Hi,

    Please refer to the below mentioned forum links where procedure to modify the template of the C1TreeView at runtime is discussed:
    http://our.componentone.com/groups/topic/block-the-collapseexpand-button-treeview/
    http://our.componentone.com/groups/topic/c1treeviev-how-to-change-default-icons-of-c1treeview-using-c-code-behind/

    Hope it helps.

    Thanks,
    Akshay
  • Replied 7 August 2017, 5:49 pm EST

    @Akshay_Madan said:
    Hi,

    Please refer to the below mentioned forum links where procedure to modify the template of the C1TreeView at runtime is discussed:
    http://our.componentone.com/groups/topic/block-the-collapseexpand-button-treeview/
    http://our.componentone.com/groups/topic/c1treeviev-how-to-change-default-icons-of-c1treeview-using-c-code-behind/

    Hope it helps.

    Thanks,
    Akshay


    Akshay,

    I noticed that the examples that you referred me are referring to the way to expand the treeview, my doubt would be to create this treeview with more than 4 thousand records dynamically.

    For each hierarchical level of my treeview I have 1 image and 1 information that comes from the database, and I will like to create this treeview using itemssource and not doing foreach, it can be using itemssource or some other more perfomical way.
  • Replied 7 August 2017, 5:49 pm EST

    Hi,

    You can use C1HierarchicalDataTemplate to control the appearance of hierarchical items. It allows you to specify the template to apply to each element in our data source, and a property indicating where to find the elements for the next level on the hierarchy.

    Please download the sample application implementing the same from the link given below:
    http://samples.componentone.com/RepositoryA/Samples_3x/C1Silverlight/Samples/C1.Silverlight/CS/C1TreeViewTemplateSample/C1TreeViewTemplateSample.zip

    Also refer to the Data Source Creation tab in the documentation link given below for more information:
    http://helpcentral.componentone.com/nethelp/C1BasicWPFSL/TreeView%20Elements.html

    Please let me know if there is any difference in our understanding.

    Thanks,
    Akshay
Need extra support?

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

Learn More

Forum Channels