StrataFrame Forum

PanelManager and the Form's Error Provider Behavior

http://forum.strataframe.net/Topic13616.aspx

By fansanitis - 1/22/2008

I have table with a large number of columns that I'm NOT allowed to modify.  The columns can be categorized by patient, procedure, diagnosis, etc.  Rather than try and jam all the columns onto a single maintenance form I wanted to create a form that uses a panel manager with a page for each "category" of data.  I'd use a themedlinkmenu for navigation between the category page.  Before I design the form I have some questions on how the error provider will behave. 

When a Save is performed, how will the error provider which is defined at the form level react?  Will it show only the errors on the current (visible) page?  What if there are no errors on the current page but there are on other non-visible pages?

Thanks!!

By Greg McGuffey - 1/22/2008

I'm assuming that by "error provider" you mean the SF broken rules error provider. The error provider doesn't know or care if the control is visible. The default behavior of the SF broken rules is to show an info message (red message that scrolls up from lower left corner of form) indicating that there are broken rules and setup the error provider (if you configured it that way) to show the icon and setting the error message that is shown as the tooltip on that icon. It also clears the errors when they are fixed (I believe during a save or undo).



If you want to show a summary of those broken rules or activate the panel with the first broken rule, you'll need to handle the BusinessRulesChecked event on the BO and manage that yourself.
By fansanitis - 1/22/2008

I have a standard SF form that has a PanelManager and ThemedLinkMenu control.  The ThemedLinkMenu control is used to navigate to different Pages on the PanelManager.  Each Page has its own custom toolstrip for editing, saving, navigation, etc.  When a save is performed, the ErrorProvider pops up an icon (with associated tooltip) next to each field in error but the Broken Rules Infobox does not appear.  The form's AutoShowBrokenRulesAlert is set to True.  Is there something else I'm missing?

THanks!!

By Trent L. Taylor - 1/22/2008

Is there something else I'm missing?

The red InfoBox that appears is plumbed in through the BaseForm logic...I beleive.  So if you are calling the MyBO.Save() instead, then this may not appear.  However, if you call the forms Save() then you will probably see the message.  In any case, you can show this message yourself very easily as all of the values are given to you int he BusinessRulesChecked event.  So if you have he need, you can show this window yourself very easily by just calling the InfoBox class directly.

By fansanitis - 1/23/2008

I added calls to the InfoBox class after all unsuccessful BO.Save() method calls.  Thanks!!
By Trent L. Taylor - 1/23/2008

No problem Smile