HierarchicalDataTemplate & IsCheckable

4 posts, 1 answers
  1. Richard
    Richard avatar
    72 posts
    Member since:
    Feb 2009

    Posted 29 Sep 2011 Link to this post


    I'm having an issue with the HierarchicalDataTemplate & IsCheckable , I have seen a few posts about it here but none seem to answer my problem.

    I have a hierarchical data source on a menu, when I run my project without the IsCheckable property the menu has its items and sub items. However when I add the IsCheckable property only the top level of the menu shows and it is checkable. 

    Any ideas why ? 

    Richard

    <telerik:HierarchicalDataTemplate x:Key="FilterMenuTemplate" ItemsSource="{Binding SubItems}">
        <telerik:ContainerBinding.ContainerBindings>
            <telerik:ContainerBindingCollection>
                <telerik:ContainerBinding PropertyName="IsChecked"  Binding="{Binding IsChecked, Mode=TwoWay}" />
                <telerik:ContainerBinding PropertyName="IsCheckable" Binding="{Binding IsCheckable}" />
                <telerik:ContainerBinding PropertyName="StaysOpenOnClick" Binding="{Binding IsCheckable}" />
            </telerik:ContainerBindingCollection>
        </telerik:ContainerBinding.ContainerBindings>
        <TextBlock Text="{Binding Text}" />
    </telerik:HierarchicalDataTemplate>

  2. Answer
    Pana
    Admin
    Pana avatar
    748 posts

    Posted 30 Sep 2011 Link to this post

    Hi Richard,

    IsCheckable = True items are considered checkboxes and do not show subitems. You could still set IsChecked on a non checkable item but if you want the submenus to appear mark their parents as non checkable.

    Best wishes,
    Pana
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
  4. Richard
    Richard avatar
    72 posts
    Member since:
    Feb 2009

    Posted 30 Sep 2011 Link to this post

    I see,  I need the parent to be clickable but as this is for a generating a report I think I'll be able to use the TreeView to achieve my goals.

    Thanks,
    Richard 
  5. Pana
    Admin
    Pana avatar
    748 posts

    Posted 30 Sep 2011 Link to this post

    Hello Richard,

    In such case a RadTreeView would indeed serve better your scenario.

    Best wishes,
    Pana
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top