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

Bring TreeItem into view with horizontal scroll?

1 Answer 82 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Buzz
Top achievements
Rank 1
Buzz asked on 30 Mar 2012, 02:23 AM
BringPathIntoView vertically scrolls my treeview so the end path item is "in view", however the item is hidden to the right because the treeview is in a narrow container.  How can I get the treeview to auto scroll horizontally over so the item is truly in view?

Thanks
Buzz

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 03 Apr 2012, 07:10 AM
Hi,

 I guess you mean that you cannot see the whole RadTreeViewItem. In order to workaround this, you can scroll the ScrollViewer of the tree horizontally like so:

private void Button_Click(object sender, RoutedEventArgs e)
     {
       RadTreeViewItem container =  this.treeViewDepartments.GetItemByPath(this.bringPathBox.Text,"|");
       container.BringIntoView();
       this.treeViewDepartments.ScrollViewer.ScrollToHorizontalOffset(this.treeViewDepartments.ItemsIndent * (container.Level + 1));
     }

Please let us know if this is suitable for you.

Regards,
Petar Mladenov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
TreeView
Asked by
Buzz
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or