Hello
I'm having a bit of a problem with an AJAX update from within a RadTree, I've had a look around the forums and can't find a proper answer to my prolem although I have stumbled across a couple of posts that given me a couple of ideas. Anyway, here is my problem, I hope someone can help.
What I'm effectivly trying to do is differentiate between clicking on a node in a RadTreeVew (to update the main panel) and dragging a node in a RadTreeView (to update a graph) during an AJAX update, unfortuately it seems that the EventName property of the RadAjaxManager AjaxSetting does not work as mentioned in this post (http://www.telerik.com/community/forums/aspnet-ajax/ajax/ajax-manager-event-filter.aspx) reading on on this post Nicholas Walker (10th post) suggests a workaround in which you use the OnClientNodeClicked and OnClientNodeDropped properties of the RadTreeView to fire some JavaScript which modifies(?) the RadAjaxManager. I can get one or the other to work and I'm not really sure how the JavaScript fits in, ideally for one or the other, I want to disable the opposite manager update but I'm not sure how this could be done with javascript, or whether it could be done at all.
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"radTree"
EventName
=
"onTreeViewNodeDrop"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"divWatchMeasureChart1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"lbMeasureName"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"radTree"
EventName
=
"onTreeViewNodeClicked"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"mainRight"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
div
class
=
"treeHolder"
>
<
telerik:RadTreeView
ID
=
"radTree"
Runat
=
"server"
Skin
=
"Windows7"
onclientnodedatabound
=
"OnClientNodeDataBoundHandler"
onnodeclick
=
"radTree_NodeClick"
EnableDragAndDrop
=
"True"
OnNodeDrop
=
"RadTreeView1_NodeDrop"
OnClientNodeClicked
=
"onTreeViewNodeClicked"
OnClientNodeDropped
=
"onTreeViewNodeDrop"
>
<
WebServiceSettings
Path
=
"~\Controls\WebController.aspx"
Method
=
"GetChildren"
/>
</
telerik:RadTreeView
>
<
div
>
<
telerik:RadScriptBlock
runat
=
"server"
>
<
script
language
=
"javascript"
>
function OnClientNodeDataBoundHandler(sender, e) {
var node = e.get_node();
node.set_toolTip(node.get_attributes().getAttribute("ToolTip"));
}
function onTreeViewNodeClicked(sender, eventArgs)
{
var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
if (ajaxManager != null)
{
var settings = ajaxManager.get_ajaxSettings();
for (setting in settings)
{
var initiatingControl = settings[setting].InitControlID;
var controls = settings[setting].UpdatedControls;
if (initiatingControl == '<%= radTree.ClientID %>') {
for (control in controls)
{
if (controls[control].ControlID != "mainRight")
{//disable all other updates perhaps?
}
}
}
}
ajaxManager.set_ajaxSettings(settings);
}
}
function onTreeViewNodeDrop(sender, eventArgs)
{
var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
if (ajaxManager != null) {
var settings = ajaxManager.get_ajaxSettings();
for (setting in settings) {
var initiatingControl = settings[setting].InitControlID;
var controls = settings[setting].UpdatedControls;
if (initiatingControl == '<%= radTree.ClientID %>') {
for (control in controls)
{
if (controls[control].ControlID != "CntrlViewOverview1_divWatchMeasureChart1")
{//disable all other updates perhaps?
}
}
}
}
ajaxManager.set_ajaxSettings(settings);
}
}
</
script
>
</
telerik:RadScriptBlock
>
This whole issue seems to be a bit of an oversight as it would seem sensible that you would want to react to a drag differently to a click, hopefully someone will have an answer to this and eny my multi-day efforts in getting this working. Thank you.