locked
EnsureVisible() in TreeView fails in WindowsMobile 6.x RRS feed

  • Question

  • Hallo,

    I am using the EnsureVisible()-Method of the TreeView class in the following way:

    this.treeView1.SelectedNode.EnsureVisible();
    

    Unfortunaltely the method doesn´t seem to have any effect, because I need to scroll to the selectedNode. Is it possible, that EnsureVisble() is not supportet in .NET CE althoug Intellisense offers me the method? If not, how can I ensure the visibility of the node?

    Thanks and best regards,

    Tobias
    Tobias Schneider Lehrstuhl für Angewandte Informatik IV Universität Bayreuth Universitätsstraße 30 95447 Bayreuth
    Tuesday, November 9, 2010 9:41 PM

Answers

  • Hi,

    It works fine in my local. Could you provides your completed code, which can help me find the issue. Email: v-gubian@microsoft.com

     Do you try it on emulator, I tried it on WM6.0,6.5 emulator, both of them work fine.

    Best regards,
    Guang-Ming Bian - MSFT


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Marked as answer by Bin-ze Zhao Tuesday, December 7, 2010 7:11 AM
    Tuesday, November 16, 2010 5:35 AM

All replies

  • Hi,

    This method will show your selected node to be shown on the screen, although it is out of the screen. It will not always show the node while scrolling. Just take the node to be shown on the screen.

     

    Best regards,
    Guang-Ming Bian - MSFT


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Thursday, November 11, 2010 5:21 AM
  • Hi,

     

    but thats what i meant and it doesn´t work. Sometimes a get quite a long treeView and insert a new node. Actually, the treevIew is so long that the node is not visible on the screen. To fix that I call the treeView.SelectedNode.EnsureVisible()-Method. According to the method description:

    "When the EnsureVisible method is called, the tree is expanded and scrolled to ensure that the current tree node is visible in the TreeView ."

    on  http://msdn.microsoft.com/en-us/library/system.windows.forms.treenode.ensurevisible.aspx

    I would expect that after the call the node in question would be visible on the screen. But nothing happened.

     

    Best Regards,

    Tobias Schneider


    Tobias Schneider Lehrstuhl für Angewandte Informatik IV Universität Bayreuth Universitätsstraße 30 95447 Bayreuth
    Friday, November 12, 2010 8:41 PM
  • Hi,

    It works fine in my local. Could you provides your completed code, which can help me find the issue. Email: v-gubian@microsoft.com

     Do you try it on emulator, I tried it on WM6.0,6.5 emulator, both of them work fine.

    Best regards,
    Guang-Ming Bian - MSFT


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Marked as answer by Bin-ze Zhao Tuesday, December 7, 2010 7:11 AM
    Tuesday, November 16, 2010 5:35 AM