none
Treeview, keep focus on clicked node ? RRS feed

  • Question

  • First post here, hope I am in the right location.

    I am using Visual Studio Express 2103 for web. On my asp page I have a Treeview with 4 Levels. From sql server I load the hierarchy as

    TopLevel-->

                      Product-->

                                       Keyword-->

                                                           Article

    User would click on product, then view a list of all keywords, click on the keyword and then see a list of all articles with this keyword, when the article is clicked, the related information will be shown in various text boxes to the right of the tree.

    The problem I have is that when I scroll down the list on my web page, and click any nodes that are more than 1 page down, the focus (for lack of a better word) jumps to the top of the page, now I have to scroll all the way down to the node clicked.

    How can I prevent all of this scrolling and keep the focus on the last clicked node, whether it is on the first or the tenth page.

     

    Thank you in advance.

    • Moved by Carl Cai Monday, August 18, 2014 2:07 AM (from vb.net)more related to suggested forum
    Friday, August 15, 2014 6:27 PM

Answers

  • Thanks, I have done this before in regular VBA but unfortunately selectednode property is read only in ASP.

    I have since posted up in the ASP.net forum here asp.net


    Hi Andre,

    Since you have got where to get supports for asp.net issues, I would recommend you focus on that thread to get help.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Andre Uys Monday, August 18, 2014 2:07 AM
    Monday, August 18, 2014 2:06 AM
  • Thanks, got my solution here
    • Marked as answer by Andre Uys Monday, August 18, 2014 2:09 AM
    Monday, August 18, 2014 2:08 AM

All replies

  • Maybe you should ask in the ASP.NET forum you may get better response.

    I have never used the treeview on a web page so I am not sure what you are describing exactly. I guess you know you can set the selected node to what you want in the after expand event or similar ie:

        MyTreeView.SelectedNode = e.node

    where e.node is the TreeViewEventArgs from the event handler sub.

    Or you can e.cancel = true in the BeforeSelect event to keep the selected index from changing in certain cases..

    Maybe you need to take that kind of approach where you set the .selectednode yourself? Its hard to say without studying your code.

    • Proposed as answer by Carl Cai Monday, August 18, 2014 2:05 AM
    • Unproposed as answer by Andre Uys Monday, August 18, 2014 2:09 AM
    Saturday, August 16, 2014 1:45 AM
  • Thanks, I have done this before in regular VBA but unfortunately selectednode property is read only in ASP.

    I have since posted up in the ASP.net forum here asp.net


    • Edited by Andre Uys Saturday, August 16, 2014 9:11 PM
    Saturday, August 16, 2014 9:11 PM
  • Thanks, I have done this before in regular VBA but unfortunately selectednode property is read only in ASP.

    I have since posted up in the ASP.net forum here asp.net


    Hi Andre,

    Since you have got where to get supports for asp.net issues, I would recommend you focus on that thread to get help.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Andre Uys Monday, August 18, 2014 2:07 AM
    Monday, August 18, 2014 2:06 AM
  • Thanks, got my solution here
    • Marked as answer by Andre Uys Monday, August 18, 2014 2:09 AM
    Monday, August 18, 2014 2:08 AM