StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Error handling...Expand / Collapse
Author
Message
Posted 09/27/2006 5:45:34 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
Can I use the broken rule mechanism in the form to validate my own controls? Is there a way that I can check a bunch of things as a sort of validation then have it all pop up like you do when there are broken rules...

Post #3147
Posted 09/28/2006 8:18:04 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 4:50:35 PM
Posts: 4,796, Visits: 4,766
Well, I don't know what you are trying to accomplish, but you can just add a broken rule to a business object and have it do it for you.  Otherwise you will need to create your own error provider and associate it with a control to display errors like that.
Post #3151
Posted 09/28/2006 8:40:09 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
Thats pretty much what I wanted to know. Thanks.
Post #3152
Posted 09/28/2006 9:31:11 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 4:50:35 PM
Posts: 4,796, Visits: 4,766
Sorry if this wasn't the answser you were looking for
Post #3154
Posted 09/28/2006 9:50:08 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
The error provider itself is part of the StrataFrame form, not the business object, so you can use methods on the form to set the error provider if necessary like this:

'-- Set a control in error
Me.SetErrorProvider(Me.TextBox1, "Error message")

'-- Clear error on control
Me.SetErrorProvider(Me.TextBox1, String.Empty)

'-- Clear the errors on all controls
Me.ClearErrorProvider()


www.bungie.net
Post #3158
Posted 09/28/2006 10:00:38 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
Posts: 436, Visits: 944
Thanks Ben that is more of what I was looking for... I was merely saying that I liked the mechanism where you added all the broken rules to a collection and then it populated all the error providers and displayed an Info box. I was just curious if there was a way to use that functionality anywhere other than a BO.

Ben's answer helps because now I can use the error provider you guys added to the form without adding my own. It seems trivial but I try my best to be effcient. sometimes it works.
Post #3162
Posted 09/28/2006 1:51:36 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
Yes, it does help to be efficient, but sometimes, in some cases, like this one, you have to do things by hand, and adding extraneous broken rules to a business object might cause other issues but if you have a reference to the form, you can do just about anything   You can always add your own error provider as well... it's just a component listed in the "All Windows Forms" toolbox tab.


www.bungie.net
Post #3169
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 6:39am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.125. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.