Treeview OnNodeClick without Page Load

2 posts, 0 answers
  1. Lucas
    Lucas avatar
    1 posts
    Member since:
    May 2013

    Posted 02 May 2013 Link to this post

    Hey all,

    I would like to know, if it's possible to click on a node with an OnNodeClick attribute, but without a page reload.

    My situation:
    I have a treeview with multiple nodes and a label for some text.
    Now I want to click on a node and my CodeBehind c#-code should work with the value of the node I clicked.
    After it finished the work, I want to get a text in my label and the treeview should be at the same position as it was, when I clicked.

    But when I click a node the page reloads. The CodeBehind, will be executed and my label shows different text, but my treeview is collapsed, because the paged reloaded.

    So, is there any way to block the reload?

    Greetz
    Lucas
  2. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 06 May 2013 Link to this post

    Hi Lucas,

    You cannot trigger a server event without invoking a postback. However RadTreeView preserves it's expand state upon postbacks by default, so if it appears collapsed after each postback, it's probably related to some of your custom logic. Perhaps you are rebinding the TreeView on each postback, ot too late in the page lifecycle. It's not possible to pinpoint the exact reason without looking at your code.
     

    Regards,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top