ItemContainerStyle breaks first level of data binding

8 posts, 0 answers
  1. Ryan Black
    Ryan Black avatar
    54 posts
    Member since:
    Mar 2010

    Posted 24 Jun 2010 Link to this post

    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
  2. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 29 Jun 2010 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Ryan Black
    Ryan Black avatar
    54 posts
    Member since:
    Mar 2010

    Posted 29 Jun 2010 Link to this post

    Miro

    Here is a direct link to the project.


    Ryan
  5. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 02 Jul 2010 Link to this post

    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
  6. Ryan Black
    Ryan Black avatar
    54 posts
    Member since:
    Mar 2010

    Posted 02 Jul 2010 Link to this post

    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
  7. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 08 Jul 2010 Link to this post

    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
  8. Ryan Black
    Ryan Black avatar
    54 posts
    Member since:
    Mar 2010

    Posted 20 Jul 2010 Link to this post

    Miro,

    What is the status on this issue?  

    Thanks
    Ryan
  9. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 21 Jul 2010 Link to this post

    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
Back to Top
UI for WPF is Visual Studio 2017 Ready