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

RadTreeView not resizing dynamically

1 Answer 203 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Arthur
Top achievements
Rank 1
Arthur asked on 21 Aug 2013, 03:30 PM
Hi


I have a RadTreeView bound to an observable collection. The width is specified as Auto so I would expect  that the tree view should resize dynamically.

So what I am seeing is


1) First set of data is bound, with an Items whose content is long. The treeview expands to an appropriate width.
2) The data bound is changed so that all the items are a couple character. The treeview  is still the same width

I would expect the width to change in conjunction with the size of the data bound

Cheers

Arthur

1 Answer, 1 is accepted

Sort by
0
Accepted
Tina Stancheva
Telerik team
answered on 21 Aug 2013, 05:35 PM
Hello Arthur,

Can you check whether you've changed the default RadTreeView HorizontalAlignment property value? If you haven't, then it is Stretch, which means that the control will take up as much space as possible - actually it will take as much space as its container allows it to take.

And in your case, even if you apply an Auto Width, as long as the HorizontalAlignment of the control is Stretch, the control will try to take all available space. Instead, if you set the HorizontalAlignment to Left, the control will take only as much space as it needs to display its children.

Having the above information in mind, please try setting HorizontalAlignment to Left and get back to us if that doesn't help.

Regards,
Tina Stancheva
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
TreeView
Asked by
Arthur
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or