Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DropDownList Binding
Message
De
13/09/2010 15:28:40
 
 
À
13/09/2010 13:32:07
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01480952
Message ID:
01481029
Vues:
29
>>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

Ah, so those properties are for the source of the lookup list. I have been told that if I were to use the native .Net stuff I should just need to do this:
myCombo.DataSource = myDataSet.Tables["Client"];
myCombo.DisplayMember = "ClientType";
Shouldn't it be as easy as that in MM.NET?

I am just using the default form as described in the jump start for winforms. There is a list page where I let the user specify some search criteria and then display a list of the found items, then they can click on the details page. There is also a default navigation toolbar with the form. I've been looking for an "OnNavigate" method or something similar, but not finding anything that looks like the right place. Where would you suggest?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform