This is a migrated thread and some comments may be shown as answers.

How to build a treelistview to show such data?

3 Answers 102 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Jerry
Top achievements
Rank 1
Jerry asked on 16 Oct 2010, 09:36 AM
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.


3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 20 Oct 2010, 04:38 PM
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
0
Chris
Top achievements
Rank 2
answered on 26 Aug 2011, 02:37 AM
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.
0
Maya
Telerik team
answered on 26 Aug 2011, 12:20 PM
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 ?
  Greetings,
Maya
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 >>

Tags
TreeListView
Asked by
Jerry
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Chris
Top achievements
Rank 2
Maya
Telerik team
Share this question
or