I've PreviewMouseDown
event on TreeView in order to determine if user can select other item based on some logic.
If the current item data changed, will appear MessageBox that asks the user if he want to discard the changes. if user press YES , I set e.Handled = false;
to enable the new selection. and if user press NO, I set e.Handled = true;
to cancel the new selection.
The problem is that although I set e.Handled = false
, the event stop and no selection event occurs on TreeView. Someone has solution for that?
Thanks in advance!
The focus change to the message box cancels the mouse down event so it doesn't matter whether it is handled or not. Since you know which item the user was trying to select before you displayed the message box, simply select that item programmatically if the user presses YES.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With