I have a RadTreeView that I am binding to some data.
I would like to have all the items in the tree expanded by default.
The issue I have when I do this is that the tree is autoscrolling to the right to bring into focus the most right hand expanded item.
To try and get round this I have disabled the horizontal scroll bar, call ExpandAll(), then after that reenable the horizontal scroll bar.
This is not working.
private
void
FrameworkElement_OnLoaded(
object
sender, RoutedEventArgs e)
{
RadTreeView rtv = sender
as
RadTreeView;
if
(rtv.ScrollViewer !=
null
)
{
rtv.ScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
rtv.ExpandAll();
rtv.ScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
}
}
Please can you advise on the correct way to achieve this?
Thanks.