Style RadTreeViewItem to Stretch to full horizontal width

2 posts, 0 answers
  1. Shayne
    Shayne avatar
    5 posts
    Member since:
    May 2012

    Posted 28 May 2012 Link to this post

    Hello,

    I'm trying to style a RadTreeViewItem to take up all available space in the TreeList width.  I have three items of bound data I want to show in a treeitem.  The first two being an image and a name, and the last being an image indicating a status that is to be right aligned to the very edge of the treeview where the scroll bar would appear.

    In order to do this in a WPF tree view, one has to completely override the treeview item style and use dock panels to change the effect as described here: http://leecampbell.blogspot.ca/2009/01/horizontal-stretch-on-treeviewitems.html

    I've tried different forms of Grids and dock panels, but the result always looks the same - as if the items are displayed in a stack panel.  I can see that the selected item style actually spans the width of the tree, can I get the item template to display in this manor?
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 29 May 2012 Link to this post

    Hello Shayne,

     Could you please try to set HorizontalContentAlignment of the RadTreeViewItems to Stretch and let us know if this helps you? You can set this to all items via implicit Style like so:
    <Style TagetType="telerik:RadTreeViewItem">
    <Setter Property="HorizontalContentAlignment " Value ="Stretch" />
    </Style>
     Thank you in advance.

    Regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top