RadTreeView setting IsSelected and IsExpanded properties brake the view

5 posts, 0 answers
  1. Svetoslav
    Svetoslav avatar
    10 posts
    Member since:
    Jun 2012

    Posted 26 Mar Link to this post

    Hello, I am trying to bind the items of my RadTreeView to IsSelected and IsExpanded but when I use all my items are not visible in the tree.

    I use it like this:

    <telerik:RadTreeView.ItemContainerStyle >
             <Style TargetType="telerik:RadTreeViewItem">
                 <Setter Property="IsSelected" Value="{Binding IsSelected}" />
                 <Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
             </Style>

    I tried to add to the style BasedOn="{StaticResource RadTreeViewItemStyle}" but I received warning that the style cannot be resolved, how can I use it?

  2. Svetoslav
    Svetoslav avatar
    10 posts
    Member since:
    Jun 2012

    Posted 26 Mar Link to this post

    I found workaround for me after posting this.
  3. Svetoslav
    Svetoslav avatar
    10 posts
    Member since:
    Jun 2012

    Posted 26 Mar Link to this post

    In fact it works when use the style like this:

    <Style x:Key="selectTreeDialogStyle" TargetType="telerik:RadTreeViewItem" BasedOn="{StaticResource RadTreeViewItemStyle}">
        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
        <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
    </Style>

     

    But I still get error in the designer "
    "The resource "RadTreeViewItemStyle" could not be resolved."

    I have imported these:

     

  4. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2090 posts

    Posted 29 Mar Link to this post

    Hello Svetoslav,

    The BasedOn property points to a base style. In your case, this is the RadTreeViewItemStyle which you can get only if you use the NoXaml version of the Telerik dlls. Otherwise, you don't need to set BasedOn. I could recommend you to check the following articles and see if they help for resolving the issue:
    Regards,
    Martin Ivanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Svetoslav
    Svetoslav avatar
    10 posts
    Member since:
    Jun 2012

    Posted 03 Apr Link to this post

    Thanks for the articles.
Back to Top