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

Problem with RadTreeView

11 Answers 191 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Artem
Top achievements
Rank 1
Artem asked on 16 May 2011, 04:04 PM
I have RadTreeView with many nodes in my application. So there is vertical scrollbar to scroll this tree view.
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);
So I need to scroll projectsTree to make solution node visible to simulate User click on it.

11 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 17 May 2011, 06:44 PM
Hello Artem,

You should be able to use the ScrollToVisible() function like this:

solution.ScrollToVisible();

Kind regards,
Cody
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Artem
Top achievements
Rank 1
answered on 18 May 2011, 07:02 AM
Hello

ScrollToVisible() tries to scroll browser to bring element to the screen but I need to scroll RadTreeView not browser
0
Cody
Telerik team
answered on 18 May 2011, 04:33 PM
Hello Artem,

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)?

Greetings,
Cody
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Artem
Top achievements
Rank 1
answered on 19 May 2011, 11:07 AM
There are test application and example of code attached.
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:
0
Cody
Telerik team
answered on 19 May 2011, 11:35 PM
Hello Artem,

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 >>

0
Artem
Top achievements
Rank 1
answered on 20 May 2011, 06:58 AM
Ok, thanks.

And what about the second issue(about child nodes) i've described?
0
Artem
Top achievements
Rank 1
answered on 26 May 2011, 04:09 PM
any ideas?
0
Cody
Telerik team
answered on 26 May 2011, 11:05 PM
Hello Artem,

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 >>

0
Artem
Top achievements
Rank 1
answered on 30 May 2011, 09:20 AM
But why this node is unavailable after  I'm using
treeView.FindNodeByText("Last").Expand();
?
0
Vladislav
Telerik team
answered on 30 May 2011, 01:53 PM
Hello Artem,

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 >>

0
Cody
Telerik team
answered on 10 Aug 2011, 04:09 PM
Hello Artem,

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
Vote for Telerik Test Studio at the Annual Automation Honors Voting!
Tags
General Discussions
Asked by
Artem
Top achievements
Rank 1
Answers by
Cody
Telerik team
Artem
Top achievements
Rank 1
Vladislav
Telerik team
Share this question
or