Hi,
We are binding XMLDataSource to UltraWebTree and we would like to Add/Delete/Edit nodes to the tree. I know the code for adding/deleting/edit the Nodes (at least, I have some idea).
But how do I get the updated XML from WebDataTree so that I can pass XML to other control/DB? Any ideas. Basically, I needed data in XML format from updated WebDataTree (after adding nodes/deleting nodes).
Sample:
(before adding)
<node><node1/><node2/></node>
(after adding node3), I want get following XML from webDataTree
<node><node1/><node2/><node3/></node>
Thanks,
The WebDataTree will not update the data source automatically. I suggest you to update the XML data source manually and then just rebind the data tree.
More info about XmlDataSource may be found here - http://msdn.microsoft.com/en-us/library/494y92bs.aspx#Background
Hope that helps!
Sorry, it's WebDataTree
//addNode is a button
//customerWebDataTree is Webdatatree
addNode.Click +=
new EventHandler(addNode_Click);
void
addNode_Click(object sender, EventArgs e)
{
DataTreeNode newNode = new DataTreeNode();
newNode.Text = "TEST";
newNode.Value = "TEST";
foreach (DataTreeNode node in customerWebDataTree.SelectedNodes)
node.Nodes.Add(newNode);
}
//GET UPDATED TREE STRUCTURE IN XML FORMAT
// HOW ???
thanks in advance
It doesn't get clear whether you're using UltraWebTree or WebDataTree. Can you post your code here please?