Problem with RadTreeView

12 posts, 0 answers
  1. Artem
    Artem avatar
    25 posts
    Member since:
    Jul 2010

    Posted 16 May 2011 Link to this post

    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.
  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 17 May 2011 Link to this post

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

  3. Artem
    Artem avatar
    25 posts
    Member since:
    Jul 2010

    Posted 18 May 2011 Link to this post

    Hello

    ScrollToVisible() tries to scroll browser to bring element to the screen but I need to scroll RadTreeView not browser
  4. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 18 May 2011 Link to this post

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

  5. Artem
    Artem avatar
    25 posts
    Member since:
    Jul 2010

    Posted 19 May 2011 Link to this post

    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:
  6. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 19 May 2011 Link to this post

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

  7. Artem
    Artem avatar
    25 posts
    Member since:
    Jul 2010

    Posted 20 May 2011 Link to this post

    Ok, thanks.

    And what about the second issue(about child nodes) i've described?
  8. Artem
    Artem avatar
    25 posts
    Member since:
    Jul 2010

    Posted 26 May 2011 Link to this post

    any ideas?
  9. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 26 May 2011 Link to this post

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

  10. Artem
    Artem avatar
    25 posts
    Member since:
    Jul 2010

    Posted 30 May 2011 Link to this post

    But why this node is unavailable after  I'm using
    treeView.FindNodeByText("Last").Expand();
    ?
  11. Vladislav
    Admin
    Vladislav avatar
    276 posts

    Posted 30 May 2011 Link to this post

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

  12. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 10 Aug 2011 Link to this post

    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!
Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!