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

ItemContainerStyle breaks first level of data binding

7 Answers 115 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ryan Black
Top achievements
Rank 1
Ryan Black asked on 24 Jun 2010, 06:52 PM
Everything in my project is now working perfectly except for when I add an ItemContainerStyle to the main treeview.   My data binding is messed up and none of the HierarchicalDataTemplate styling is applied for the first level.  When I remove the ItemContainerStyle from the main tree, everything works perfectly.

I have uploaded my project since this example has grown quite large.


Thanks

Ryan

7 Answers, 1 is accepted

Sort by
0
Miro Miroslavov
Telerik team
answered on 29 Jun 2010, 03:16 PM
Hi Ryan Black,

RadTreeView.ItemContainerStyle is supposed to be used as style for each items of the Tree (unless you define hierarchical template that defines new style for the child items). But if you define style in the hierarchical template you don't need ItemContainerStyle.

In order to give you more detailed support, can you please attach the project or create new support ticket with the project, because i can not open it at the filedropper?
Thank you.

All the best,
Miro Miroslavov
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
Ryan Black
Top achievements
Rank 1
answered on 29 Jun 2010, 03:35 PM
Miro

Here is a direct link to the project.


Ryan
0
Miro Miroslavov
Telerik team
answered on 02 Jul 2010, 12:55 PM
Hello Ryan Black,

It appears that the problem is in your TemplateSelector and the your sub RadTreeView, because when i use that code it work as expected:
<telerik:RadTreeView ItemsSource="{Binding Source={StaticResource TestXML}, Path=TestingDataSource}"
                        ItemTemplate="{StaticResource Scene}"
                        ItemContainerStyle="{StaticResource RadTreeViewItemStyle}"
                        MinWidth="350" />

On a side note - you can't use TemplateSelector and ItemTemplates for the child hierarchy - the first is ignored at the end. (You can check the Output window for that).

If you have further questions please ask us.


Best wishes,
Miro Miroslavov
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
Ryan Black
Top achievements
Rank 1
answered on 02 Jul 2010, 03:32 PM
Miro,

Could you help me get this example working the other way and only using TemplateSelector.  I see the errors in the output window that you are talking about.  I removed the ItemTemplate for each child hierarchy and now my overall ItemContainerStyle is not being applied and none of the data binding is working.

Thanks
Ryan
0
Miro Miroslavov
Telerik team
answered on 08 Jul 2010, 08:27 AM
Hi Ryan Black,

The problem appears to be in the changing of the Template in the ItemContainerStyle and setting ItemTemplates at the same time. I will make further investigation, if we are missing something or we have problem in the RadTreeView.
Thank you for your patience.

Kind regards,
Miro Miroslavov
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
Ryan Black
Top achievements
Rank 1
answered on 20 Jul 2010, 02:44 PM
Miro,

What is the status on this issue?  

Thanks
Ryan
0
Miro Miroslavov
Telerik team
answered on 21 Jul 2010, 07:45 AM
Hello Ryan Black,

Sorry for the late response.
The problem was that in the Control Template of the Items - you should template bind the ContentTemplateSelector property to HeaderTemplateSelector, as well as the Content and the others.
Or you may use the short code for those bindings like:

ContentSource="Header"
You can check this in the changed attached project.


Kind regards,
Miro Miroslavov
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
Tags
TreeView
Asked by
Ryan Black
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
Ryan Black
Top achievements
Rank 1
Share this question
or