Hi,
I have a tab control that has 4 tabs. There is a save button that only shows on the last tab. Sometimes the user doesn't have permissions to save the record so we make the save button visible = false in some cases.
In the form closing event we inspect the value of the save buttons visible property to know if we even have to check for dirty since they can't save if the visible property is set to false.
The problem is that if you are on any other tab than the 4th tab the save button's visible property will always be false.
Is there a way around this issue?
Thanks
Randy
This is expected behavior. We set the controls' visibility to false to ensure that they're not displayed on the screen, when they're on tabs other than the active tab.
I suggest you use a different value besides the save button's visibility to control this functionality. My advice would be to use a form-level property for this, which you can set to true or false in the same way you set the save button's visibility.
Hi Vince,
Thanks for the reply. This is very undesireable. Checking the visible property for the save button is only one problem this causes for us. We also do validation of the values in controls and we don't validate controls that are not visible. As you can imagine in a complicated application like ours that has hundreds of controls on the form and lots of controls change from visible to not visible all the time based on user input this is a big deal.
This seems like it would have other undesireable side effects too like causing the visibleChanged event to fire. We don't use this, but it seems like it could cause problems.
There must be some other work around. For example, internally Infragistics must be keeping track of what the original visible property value was so that it can be set back to the correct value when the tab is displayed. Can we have access to this property?