My company is evaluating control suites to go with, but I''m having trouble figuring out how to validate fields using the tab control.
We perform field by field validation on our screens, and we use the Validating event of each control to perform this validation. While switching tabs, we also check if data has changed and prompt the user before switching tabs, "Do you want to save changes?” Now if the user doesn''t want to save changes, then there is no need to validate and we switch tabs without performing validation.
To make this work with the standard .Net controls, we trap a windows message that gets sent when the user clicks on a new tab. This message is sent before the Validating event fires. Then in the validating event we postpone validation until after the user answers yes. If the user answers no we just switch tabs.
But with the Syncfusion tab control, I don’t know how to make this work. The SelectedIndexChanging event fires after the textbox control Validating event. Is there a property of the Syncfusion tab control that indicates it’s about to change that I can access in the textbox control Validating event?
Basically how can I get the functionality I want?
Thanks in advance,
ADAdministrator Syncfusion Team June 3, 2004 01:07 AM UTC
Thanks for your feedback on this issue. I have tested this here, and could see that the TextBox''s Validating event is fired before the TabControlAdv''s SelectedIndexChanging event. Hence this is event is not suitable for validation purposes. I have contacted the folks at the development team for their assistance in this regard and will update you as soon as possible. We appreciate your patience and cooperation.
ADAdministrator Syncfusion Team June 3, 2004 09:20 PM UTC
You could try the TabPageAdv''s Validating event for this purpose. Let me know if this works for you.
TOToddJune 3, 2004 10:04 PM UTC
Well TabPageAdv''s Validating event fires after the textbox control''s Validating event, so I''m still not clear how to perform field by field validation and allow the user to switch tabs gracefully as described above. With your understanding of the TabControlAdv, is the functionality I want possible?
I appreciate your time, and we do like your grid controls.
ADAdministrator Syncfusion Team June 8, 2004 01:01 PM UTC
Please refer to the sample attached. The first tabpage has username and password TextBoxes. Only after validating the entries in the TextBoxes (i.e., authenticating the user) will the TabControl allow the user to switch tabs. This check is performed within the first tabpage''s Validating event handler. Let me know if this helps. We appreciate your interest in Syncfusion products.