The XtraTabControl does not seem to retain events in the same manner as the build in Windows tab control.
In the attached example, if you change the text in the textbox on the Windows tab control and click on the next tab, if you answer yes, the tab will change. Answering no causes the textbox's validating event to fail (the CancelEventArgs is set to true) and the tab is not changed. If you perform the same steps on the text box located in the XtraTabControl, the tab page will never change.
Is there a way to make the XtraTabControl behave like the Windows tab control or do I need to use the Windows tab control to get this functionality?
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Allen,
When you display the message box, the XtraTabControl doesn't get the focus, so that the SelectedPageChanging event is not fired. As an alternative, I suggest that you consider the possibilty of using one of approaches mentioned in the AQ8999 thread:
Thank you,
Paul
The act of changing focus (the text box loosing focus) is what causes the validating event to be fired. In fact, the XtraTabControl does receive focus. I've demonstrated this in the updated project (attached).
The example I provided was simple, for the sake of demonstration. In my case, I'm using user controls that sometimes will be placed on a tab control and sometimes won't. I can't rely on the SelectedPageChanging event to validate my controls as they won't always be on a tab.
I found another article (DQ43896) that made XtraTabControls container style, but I cannot find any such property. If this cannot be done using the XtraTabControl, fine. I've got a work around using the built in WinForm tab control. However, I prefer to use the DevExpress controls because they're more feature rich and I like to provide a consistent look and feel throughout the application.
Hello Allen,
Thank you for the sample project. After some investigation, I've discovered that the XtraTabControl cannot be configured to validate as you wish. So, I suggest that you keep using the standard tab control. You can also post a suggestion on improving the XtraTabControl to the Support Center and we'll consider the ability to implement it.
Thank you,
Paul