Jacky Chau
Top achievements
Rank 1
Jacky Chau
asked on 19 Aug 2008, 03:51 PM
Is there a way to set AllowDrop and AllowDrag for load on demand nodes? I dont see those two properties in RadTreeNodeData.
9 Answers, 1 is accepted
0
Hello Jacky Chau,
I suggest that you set custom attributes (e.g. "allowDrop" and "allowDrag") when you create the child nodes and then subscribe to the OnClientNodePopulated client-side event, iterate through the child nodes get the attributes and set their AllowDrop and AllowDrag properties using the methods: set_allowDrop and set_allowDrag
I hope this will get you started.
Regards,
Veskoni
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I suggest that you set custom attributes (e.g. "allowDrop" and "allowDrag") when you create the child nodes and then subscribe to the OnClientNodePopulated client-side event, iterate through the child nodes get the attributes and set their AllowDrop and AllowDrag properties using the methods: set_allowDrop and set_allowDrag
I hope this will get you started.
Regards,
Veskoni
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
macy
Top achievements
Rank 1
answered on 07 Nov 2011, 01:22 PM
Hi
I work with thees methodes. But after a Postback on the page the settings are reseted.
It meens i set allowDarg to false and after a PostBack the nodes can draged.
Whats Wrong?
Regards Markus
I work with thees methodes. But after a Postback on the page the settings are reseted.
It meens i set allowDarg to false and after a PostBack the nodes can draged.
Whats Wrong?
Regards Markus
0
Hi Macy,
It is expected if you don't use special custom attributes fields as suggested in the previous post for these properties since they won't be stored and persisted anywhere.
Hope this will be helpful.
All the best,
Plamen Zdravkov
the Telerik team
It is expected if you don't use special custom attributes fields as suggested in the previous post for these properties since they won't be stored and persisted anywhere.
Hope this will be helpful.
All the best,
Plamen Zdravkov
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
0
macy
Top achievements
Rank 1
answered on 14 Nov 2011, 11:34 AM
Hi
But how should i work with AllowDrop and AllowDrag if i use a web-service to get the sub-Elements? Because RadTreeNodeData do not have a property for AllowDrop And AllowDrag
Regards
Markus
But how should i work with AllowDrop and AllowDrag if i use a web-service to get the sub-Elements? Because RadTreeNodeData do not have a property for AllowDrop And AllowDrag
Regards
Markus
0
Hello Macy,
Here is the code that follows the suggestion of Veselin:
Hope this will be helpful.
Best wishes,
Plamen Zdravkov
the Telerik team
Here is the code that follows the suggestion of Veselin:
foreach
(DataRow row
in
productCategories.Rows)
{
RadTreeNodeData itemData =
new
RadTreeNodeData();
itemData.Attributes.Add(
"a"
, (
object
)
"a"
);
function
OnClientNodePopulated(sender, args) {
alert(args.get_node().get_nodes().getItem(3).get_attributes().getAttribute(
"a"
));
args.get_node().get_nodes().getItem(3).set_allowDrop(
true
);
}
Hope this will be helpful.
Best wishes,
Plamen Zdravkov
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
0
macy
Top achievements
Rank 1
answered on 12 Dec 2011, 01:05 PM
Hi
This solution is already known to me. But how to get to a stable closure of drag and drop individual elements if they are after a postback attributes gone. So after a postback all nodes that have been locked in the Web service will be active.
Thus it is not really a solution, can work with.
Why the class "RadTreeNodeData" has no Attributte "AllowDrag" and "AllowDrop" as RadTreeNode? they are stable and survive a postback.
Regards
Markus
0
Hello Macy,
Have you considered handling the client load event of the tree? The attributes persist so we can use their value to set each node's drag or drop properties after the postback as in the code:
Hope this will be helpful.
Thank you for your feature request. We will consider implementing AllowDrag and AllowDrop properties to the RadTreeNodeData.
Regards,
Plamen Zdravkov
the Telerik team
Have you considered handling the client load event of the tree? The attributes persist so we can use their value to set each node's drag or drop properties after the postback as in the code:
function
OnClientLoad(sender, args) {
var
tree = $find(
"<%=RadTreeView3.ClientID%>"
);
var
allNodes = tree.get_allNodes();
for
(
var
index
in
allNodes) {
if
(allNodes[index].get_attributes().getAttribute(
"a"
)) {
alert(allNodes[index].get_allowDrop());
allNodes[index].set_allowDrop(
false
);
alert(allNodes[index].get_text());
alert(allNodes[index].get_allowDrop());
}
}
}
Hope this will be helpful.
Thank you for your feature request. We will consider implementing AllowDrag and AllowDrop properties to the RadTreeNodeData.
Regards,
Plamen Zdravkov
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
0
mohmedsadiq modan
Top achievements
Rank 1
answered on 19 Dec 2011, 01:40 PM
Hello,
I have a same issue, do you have solution for this issue, how can we maintain node state after postaback.
Please provide better solution.
Thanks in Advance.
Mohmedsadiq
I have a same issue, do you have solution for this issue, how can we maintain node state after postaback.
Please provide better solution.
Thanks in Advance.
Mohmedsadiq
0
macy
Top achievements
Rank 1
answered on 19 Dec 2011, 08:07 PM
Hi
with the OnLoadEvent, it works. But you have to be shure, that you use booleans in the set_allowDrag
Regards Markus
with the OnLoadEvent, it works. But you have to be shure, that you use booleans in the set_allowDrag
Regards Markus