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

Style RadTreeViewItem to Stretch to full horizontal width

1 Answer 138 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Shayne
Top achievements
Rank 1
Shayne asked on 28 May 2012, 08:10 PM
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?

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 29 May 2012, 12:42 PM
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 >>

Tags
TreeView
Asked by
Shayne
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or