Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
XamDataTree ActiveNodeChanging, cancelling leaves newActiveNode highlighted
posted

In WPF/17.2, I'm using XamDataTree to select records to edit. When a record is edited, an isDirty flag is set. If user clicks another node in the XamDataTree, I use the ActiveNodeChanging event to cancel the change if the isDirty flag = true. However, upon e.Cancel = true, the e.NewActiveTreeNode remains highlighted, and the OriginalActiveTreeNode is outlined. I would expect e.Cancel would handle this better, but since it does not, I added code to clear the selected items collections, and set NewActiveTreeNode IsSelected = false, and OriginalActiveTreeNode IsSelected = true, and multiple variations on logic, yet none work.

Please describe how to reset the treeView as expected.