Hi,
How to Rename the child nodes of a dynamically loaded tree in WPF.
I am creating My Tree View Programatically in C#.
I want to Edit the Child nodes of the tree on double click. How can i achieve this.
This is .CS File
private void LoadTree1()
{
TreeViewItem treeItem = null;
treeItem = new TreeViewItem();
treeItem.Header = "North America";
treeItem.IsExpanded = true;
treeItem.Items.Add(new TreeViewItem() { Header = "USA" });
treeItem.Items.Add(new TreeViewItem() { Header = "Canada" });
treeItem.Items.Add(new TreeViewItem() { Header = "Mexico" });
tvMain.Items.Add(treeItem);
}
This is my XAML file
I should be able to edit USA,Mexico or Canada on double click on them.Pls help me out to achieve this
Thanks in Advance
Laxmidhar SahooPosted Oct 1, 2018, 7:07 AM
{
if(e.Button == MouseButtons.Right)
{
//treeviewEvents.SelectedNode is not updated with the new item and instead contains an item already selected
}
}