Question

I have a grid control in a tabcontrol. I need to validate the grid when user attempts to leave the tab. If validation fails, I need to cancel the tab change (so to disallow user to change the tab until validation succeeds).

The problem with this approach is SelectionChanged event of my tab control fires many times due to children with SelectionChanged events. This makes validation message to appear again and again.

Also for canceling the tab change, I need to re-select the same tab within the SelectionChanged event which fires the event again.

Any ideas how I can get around this issue?

Was it helpful?

Solution

look here for how to prevent a tab from changing in the first place. in that delegate you can execute your validation logic

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top