TreeView Problem - Setting focus on current Node causes scrolling

Discussion in 'ASP .Net Web Controls' started by Chris van Renen, Jun 13, 2005.

  1. Hi,

    I recently had a problem with the TreeView control as it kept jumping
    (setting focus) to the currently selected Node in the TreeView which causes a
    problem when that Node is not currently displayed on screen. In other words,
    when I try to right click (I use my own context menu) on the TreeView and the
    currently selected Node is not on screen, it scrolls down/up to that Node
    (setting the focus) and my context menu is not displayed.

    I had a look at the Javascript functions in the treeview.htc file and had to
    change a few lines to solve my problem. I changed the dofocus() function to
    accept a boolean parameter(eg. dofocus(setFocus)). I then changed the
    dofocus() call in the ondocumentready() function to supply a true parameter
    so that the initial focus is set on the page load. In the dofocus() function,
    I just do a check to see if the focus should be set on the element or not.

    Does anyone know if there is another way of doing this or am I on the right
    track? If so, I hope this will be in the next version of Webcontrols.

    Kind Regards,
    Chris van Renen
    Chris van Renen, Jun 13, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,448
  2. Jason Shohet
    Replies:
    2
    Views:
    579
    Jason Shohet
    Nov 19, 2003
  3. CB
    Replies:
    1
    Views:
    591
    Johannes Koch
    Oct 2, 2003
  4. Tjerk Wolterink
    Replies:
    2
    Views:
    1,423
    Dimitre Novatchev
    Aug 24, 2006
  5. chris

    Selecting Treeview node causes repaint - sometimes

    chris, Jul 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    134
    chris
    Jul 8, 2006
Loading...

Share This Page