But I can't find any way to scroll this tree view in my test. I need to scroll tree view to the specific node. Could you assist with it?
In my test I have following definitions
Telerik.WebAii.Controls.Xaml.RadTreeView projectsTree = Pages.xxx.SilverlightApp.yyy.Find.ByName<
Telerik.WebAii.Controls.Xaml.RadTreeView
>("rtvProjectTree");
RadTreeViewItem solution = projectsTree.FindNodeByText(solutionName);
11 Answers, 1 is accepted
You should be able to use the ScrollToVisible() function like this:
solution.ScrollToVisible();
Cody
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
ScrollToVisible() tries to scroll browser to bring element to the screen but I need to scroll RadTreeView not browser
Our framework should be trying to scroll both the container of the element (i.e. the RadTreeView) to make the element visible within the container and the browser window to make the container visible within the browser window.
Is this not happening for you as I just described it is supposed to work? Can you send me a video of this what actually happens there (Jing is a good free screen recorder) and/or a way I can repro this problem here locally for analysis (such as access to your website or a sample Silverlight app that demonstrates this problem)?
Cody
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Also I've found another issue (example is in attach). If TreeView in application is expanded so there is possibility to find/click child nodes of treeview items but if TreeView is collapsed (case 2 in examples) I'm receiving following error.
System.NullReferenceException was unhandled by user code
Message=Object reference not set to an instance of an object.
Source=Telerik.WebAii.Controls.Xaml
StackTrace:
at Telerik.WebAii.Controls.Xaml.RadTreeView.FindNode(Predicate`1 predicate)
at Telerik.WebAii.Controls.Xaml.RadTreeView.FindNodeByText(String nodeText)
at RadTreeView.WebTest1.WebTest1_CodedStep() in C:\NeA\RadTreeView\RadTreeView\WebTest1.tstest.cs:line 82
InnerException:
Thank you for submitting the test app along with the test. I have reproduced the problem you describe. You can track our progress on this issue here.
Best wishes,Cody
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
And what about the second issue(about child nodes) i've described?
In your second issue, are you referring to a non-visible node? A null reference exception is expected in such a case. We can only find and act on things that are actively visible in the UI. Thus if a root node is not expanded, all its children will be invisible, which also means they will not exist in the Silverlight Visual Tree. We use that tree to find and act on Silverlight elements. We can only act on elements that exist in the tree.
Greetings,Cody
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
treeView.FindNodeByText("Last").Expand();
Thank you for this report.
Indeed there is a problem with refresh of the RadTreeView wrapper, after expand/collapse of a RadTreeViewItem.
We have logged this issue and will our best to fix it in our upcoming release(s).
Meanwhile there is a fast/easy workaround of this issue. You just have to invoke the following:
treeView.Refresh();
right after the "Last" node is expanded.
Here is an example:
treeView.FindNodeByText(
"Last"
).Expand();
treeView.Refresh();
treeView.FindNodeByText(
"SubItem2"
).User.Click();
I hope that this solution is acceptable for you.
Your Telerik points are updated according your report.
Greetings,
Vladislav
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Good news. PITS issue 6116 has been fix and the fix is included in our latest internal build that was released yesterday, 2011.1.809.
Regards,Cody
the Telerik team