1

I have two panes in my page (category and items). The category pane is basically a n-level tree view which controls what items are to be shown on the items pane on the right. So if I choose a category, the items panel on the right hand side will show all items in that particular category (in a datagrid). I am fetching the items from a WCF service in the SelectedItemChanged event.

Now the items grid in the right pane is an editable datagrid. So when a user has some unsaved changes in the grid and tries to change the category, I need to give him a warning message (message box with Ok/Cancel) and on cancel click, I need to suppress this category selection change.

Now, I have tried the the MouseLeftButtonDown event to suppress this, but it somehow doesn't seem to work.

I have refereed this link for the possible solutions.

Can anyone please suggest something?

Community
  • 1
  • 1
Vinod
  • 929
  • 1
  • 16
  • 42

1 Answers1

0

At the end of your selectedItemChanged event, call [yourTreeView].ClearSelection()

This will give the appearance of the treeview not performing a selection, yet will react as a click.