This is probably the way things work but it gave me fits for a while trying to find why it was happening.
MY QUESTION : Some feedback would be appreciated if there is a better way to handle this type of scenario.
- I use the LostFocus event on various controls to do some “on the fly” editing during user input.
- I have a property called “EditGuard” that I set TRUE and test it in the LostFocus events for some circumstances to avoid the edits.
- My record selection is done from a Dialog that slides down over the Webpage and presents a list of various records in a ListBox. You click a record in the ListBox and then the SELECT button.
- The SELECT button in the Dialog calls the “Read A Record” Method in the underlying Webpage that updates the various Webpage controls then closes itself.
- At the end of the “Read A Record” method I turn off the EditGuard flag.
- It seems every control EXCEPT the RadioGroup controls observe the EditGuard flag because their SelectionChanged events happen very quickly.
- It seems the SelectionChanged event on RadioGroup controls is delayed for a while and fires AFTER the “Read A Record” Method completes.
My solution was to add a One Shot timer at the end of the “Read A Record” Method to turn off the EditGuard after a very short delay rather than when the Method finishes. This gives time for the RadioGroup controls SelectionChanged event to fire.
Is there a better way?