tips on dating a polish man - Csharp control validating

by  |  10-Mar-2020 01:13

Is there a way to prevent the user from leaving a tab on a Tab Control until all the controls on that tab have finished validating? Another approach would be to somehow cancel the pending validating event when the user selects another tab page. I can setup a tab page leave event, but to what benefit? According to MSDN events happen in following order: Focus events occur in the following order: 1.. I would allow user to fill pages in the order he/she prefers and jump between them at will. Being able to do that might help for my particular circumstances. For certain control, once it has focus, it will validate its data for closing, leaving, etc.. So the only problem when changing pages is when all the child controls on the form have no focus, then swith pages will not trigger the child controls' validating events.The problem I am experiencing is when a control fails its validating event and the user clicks another tab things get messy. Thanks Dennis "Alex S" Hi, Dennis did you try to hook Tab Page. Otherwise it is better to use Wizard-style approach, when consecutive screens are shown each after another and errors on screen N do not allow to go to screen N 1. Another approach would be to somehow cancel the pending validating event when the user selects another tab page. I can setup a tab page leave event, but to what benefit? According to MSDN events happen in following order: Focus events occur in the following order: 1.. For this issue, I think there are 2 workarounds: 1.

Drumm" all the controls on that tab have finished validating?

To swith back to the original tabpage, you may use a variable to store the original page index.

Ideally, I think the best solution is not to leave a tab until the validating event has completed successfully. According to MSDN events happen in following order: Focus events occur in the following order: 1.. Thanks Dennis "Alex S" Hi, Dennis did you try to hook Tab Page. loop all the controls on the tabpage, then judge if each control is the default value(We suspect the default value is not the valid value), if it is the default value, does not allow the index change. You may add a custom validating type event for each tabpage, then when registering event handler for child control's Validating event, you should also register it for the tabpage custom event, then in Tab Control.

Thanks, Dennis Hi, Dennis did you try to hook Tab Page. Selected Index Changed event, you can explicit invoke all the validating event handler, if not valid, then swith back to the orignal tabpage.

Validation is important part of any web application.

Community Discussion