This is a migrated thread and some comments may be shown as answers.

Treeview OnNodeClick without Page Load

1 Answer 86 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Lucas
Top achievements
Rank 1
Lucas asked on 02 May 2013, 08:20 AM
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

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 06 May 2013, 01:15 PM
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.
Tags
TreeView
Asked by
Lucas
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or