So it would be 2 scenarios on tree view:
1) Click on node initiating a refresh on another part of the page, but tree view itself remaining on screen (Nothing on the tree changes, so why bother to make it refresh).
2) Tree view node being dragged, and need for an ajax style post back to relect new version of tree.
So far as I can tell, the ajax manager does not allow for this. It creates call back after any interaction with tree (the initaitor) regardless of event it detects.
Cheers,
Andles.
6 Answers, 1 is accepted
Indeed you cannot selectively enable ajax for certain type of events. As a workaround you can use the client side events of the treeview and call the ajaxRequest client-side method of the ajax manager.
Regards,
Albert
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Can you please explain the reason for event name property on radajax manager in this case?
Cheers,
Andy
You suggested trying ajaxrequest as a work around - this also appears to be failing. My ajax request works when it is the only event defined in treeview, but as soon as I add a server side event to treeview my ajaxrequest stops doing async call back (the js function still gets called, but the async callback suddenly stops happening (I know this as the javascript alert message still apears, but the server side method call to Thread.Sleep no longer happen).
Below will not work for ajaxrequest as per onclientnodedropped - but if I remove onnodeclick="RadTreeView1_NodeClick" the ajaxrequest starts to work again. It seems I cannot use both sever side and client side at the same time??
<telerik:RadTreeView ID="RadTreeView1" Runat="server" EnableDragAndDrop="True"
EnableDragAndDropBetweenNodes="True" onclientnodedropped="clientDrop"
onnodeclick="RadTreeView1_NodeClick">
Here's a test script that will and will not work based on client side event it is wired to:
function
clientTest()
{
var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
alert("about to call server - will be 3 seconds due to Thread.Sleep(3000)")
ajaxManager.ajaxRequest("client");
alert("Just called server")
}