We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Rename xml node from a treeview

Hi, I'm trying to rename xml node via treeview control. My current treeview displays xml structure on my treeview control. Now I'm trying to rename the selected node from my treeview and then rename it and hoping to see the changes on the xml document. This is my current code below. private void tvTreeView_AfterLabelEdit(object sender,System.Windows.Forms.NodeLabelEditEventArgs e) { //rename node to xml document string xpath_query = tvTreeView.SelectedNode.FullPath.Replace("\\", "//"); System.Xml.XmlNode node = tmpxmldoc.SelectSingleNode(xpath_query); node.InnerText = e.Label; tmpxmldoc.Save(theFilename); }

Live Chat Icon For mobile
Up arrow icon