Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control Binding Problems
Message
 
To
04/10/2005 15:46:31
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01056035
Message ID:
01056100
Views:
35
Ken,

>We are having problems with binding a couple controls as follows, and would appreciate any help.
>
>For mmRadioButtons, when the BindingSource and BindingSourceMember are set to the BizObj and the field, the mmRadioButton.Text gets changed to the value of the field, instead of checking the correct option.
>
>For instance: O Apples O Oranges O Pears (Design Time)
>all get changed to: O Apples O Apples O Apples (Run Time)
>
>Are we doing something wrong here? What is correct way to set up? We are stroign the string "Apples" in the database and want it to simply select "Apples" in the radio button when bound.

Windows Forms Radio buttons are odd animals...you would expect the behavior you mentioned above, but that's not how they work. They are more a "loose confederation" of individual controls rather than acting as a single control. You can't data drive the selection, because there is not a single value that represents the selection. Each radio button in a group has its own Checked property which is either true or false.

Based on the scenario you mentioned it sounds like a combo box is more what you're looking for. If you really need to use a radio button, you may need to create your own user control that has the behavior you're looking for. Another option is to look at the Infragistics controls. I think their UltraOptionSet control behaves more as you would expect.

>2. How do you setup a mmNumericUpDown?

>For mmNumericUpDown, when the BindingSource and BindingSourceMember are set to the BizObj and the field, the application quits without any error message. If I leave the mmNumericUpDown on the page but leave the BindingSource and BindingSourceMember blank, the form comes up. These seems like a bug?

After dropping a NumericUpDown control on a form you need to set the Minimum and Maximum properties. Otherwise, if you bind a value that is out of the default range (0-100). Regarding not seeing an error message is it possible you are catching the exception custom code and it's not making it to the MM .NET error handler? I just tried this and got the expected exception message.

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform