Hi.
I'm checking out how much of an effort it is to upgrade from our current UltraWebTree 11.1 to WebDataTree 12.2.
The challenge is that the existing code uses ReadXmlText to bind/load data into the control. I do not see a similar method in WebDataTree.
The current XML format we use is not tied to a schema; so what would be the easiest way to use this data format in the WebDataTree control.
Code snippet of current implementation...
XmlTextReader resultReader = new XmlTextReader(XMLString,XmlNodeType.Document,null); ultraWebTree.ReadXmlText(resultReader,true,false);
The XMLString is something like... (I got one of the longest I could!)
Quote 189 Type of Business Class of Business Objects of Interest Object Mame 564 Joint Membership 0 Co-Assured 0 Member David Lloyd 6079811 Company name 60811 Contributors 0 Contract Rules 13 Contract for Object 1 24 Rule Rule 1 Clauses PPP111 CLause 1 for Object 1 82 CLause 2 for Object 1 83 Rule 2 for Object 1 Clauses PPP222 CLause 1 for Object 1 82 CLause 2 for Object 1 83 Payment Amount Assessment 1 Member Name 0 David LLoyd
Hello Jaydeep ,
I’m just following up to see if you’ve been able to resolve your issue. If you have any questions or concerns or if you need further assistance please let me know.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
Hello Jaydeep,
Wouldn’t it be easier in your case to set the css classes on the server side?
The DataTreeNode has a CssClass so you could loop on the server side trough the nodes and set that property.
In this way you would only need to load the xml file on the server side. Otherwise you would also have to load the xml file on the client as well.
You could for example load your file in a XmlDocument and loop trough the ChildNodes to get the Style attribute and set them to the CssClass property of the related DataTreeNodes.
Let me know if you have any questions or if you need further assistance.
Developer Support Engineer II
Anything on this yet?
Thanks for this Maya!
Incidentally we had come up with a similar recursive solution a few hours before your post!
We have some business rules for setting the style, which are part of an xslt; for instance, the xml i shared has some nodes marked with a style attribute.
So for such a source xml, can you suggest some ways to pull this attribute value in the Initialize event?
One of the solutions is to store this Style attribute in the ValueField (along with the actual value) of the node. It would be good if we can avoid this though, so that we dont have to split the actual value and Style info at both client and server side!
Hello Ajeesh,
You can loop through the nodes and set the style or the ClassName if you want. For example :
function WebDataTree1_Initialize(sender, eventArgs)
{ for (var i = 0; i < sender.getNodes().get_length(); i++) {
var currentNode = sender.getNodes().getNode(i);
currentNode.get_element().style.backgroundColor="Blue";
loopChildren(currentNode);
}
function loopChildren(node) {
for (var k = 0; k < node.getItems().get_length(); k++) {
var currentNode = sender.getNodes().getNode(k);
This will go recursively around all the nodes you have loaded in the tree and will set the background color to blue.
So using this you could loop through each node and set any style you want for it.
Let me know if you have any questions.