Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DropDownList Binding
Message
De
13/09/2010 13:32:07
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
13/09/2010 08:05:59
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01480952
Message ID:
01480999
Vues:
44
>Hi,
>
>I'm struggling with the simplest thing in a .NET Winforms application. I have a field in a table that can take one of two text strings, say "A" or "B".
>
>I want to use a combobox/dropdownlist for the user to select which one. My problem is getting the combo to show the correct value when skipping through the records. What I have done so far is set my Items collection for the combo to the values I want. But I am unsure of what I need to set to tell the control to display the value in my Client.ClientType business object. There are various properties:
>
>BindingSource - which I set to "Client" and am pretty sure that is correct.
>BindingSourceDisplayMember
>BindingSourceValue
>BindingValueSource
>
>I am not sure if these are properties native to the .NET combo or if they are part of MM .NET.
>
>I have seen some code for a combo on a web form that manually sets the combo's DisplayValue whenever a new record gets displayed. Is that the way I will need to do this?


Frank those properties are mm properties for binding and sychronizing a combo box to the value in your table. In your case it sounds like you do not have a table that holds those two values. I wouldn't either if it were only two choice such as "Female / Male" type question. If the values in the combo box match the values stored in your table then you could just select the record with the selectedValue. What are you using to navigate (skip through) your data? Just create a method to move the SelectedValue to match what is in the current record when the record is navigated.

Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform