Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control Binding Problems
Message
 
À
04/10/2005 15:46:31
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01056035
Message ID:
01056100
Vues:
36
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform