How to build a treelistview to show such data?

4 posts, 0 answers
  1. Jerry
    Jerry avatar
    7 posts
    Member since:
    Oct 2010

    Posted 16 Oct 2010 Link to this post

    hello,I am learning WPF programming and find out which WPF products will be better,I have tested Dev's,ActiproSoftware for WPF,DotNetBar for WPF and yours,I think that your product is better than others.I am build a demo application to test the perfermance and the functions we need,then meet a problem,I have no idea that to show a table data in the treelistview control,as you know,In winform applications,if we want to build a treelist view,just only to set properties named ParentFieldId and KeyFieldId,but with WPF application,it is not so easy!
    Could you help me to build the treelistview to show the data which screenshot is attached!
    Any help will be appreciated!

    Sorry for my bad English.

  2. Veselin Vasilev
    Veselin Vasilev avatar
    2992 posts

    Posted 20 Oct 2010 Link to this post

    Hi Jerry,

    Please find attached a sample project. Hope it will get you started.

    Best wishes,
    Veselin Vasilev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Chris
    Chris avatar
    19 posts
    Member since:
    Oct 2010

    Posted 25 Aug 2011 Link to this post

    The sample works on my machine, but I want to clear and repopulate each element in the treeview. I tried rebinding, but that doesn't clear the old data.

    How would I modify this sample if I want to update the treeview as a result of clicking a button?  In other words, add the contents of MyViewModel.AllData only when the button is clicked?

    I seem to get exceptions when the tree is loaded and no rows have been added.
  4. Maya
    Maya avatar
    4062 posts

    Posted 26 Aug 2011 Link to this post

    Hi Chris,

    I have tested the case by defining a single button and handling its Click event as follows:

    private void RadButton_Click(object sender, RoutedEventArgs e)
                this.tlv.ItemsSource = (this.Resources["MyViewModel"] as MyViewModel).RootItems;

    However, it works correctly on my side. I am attaching the updated sample. Is your scenario the same or am I missing something ?
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top