Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lookup Combobox in Silverlight with Data from WCF
Message
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Titre:
Lookup Combobox in Silverlight with Data from WCF
Versions des environnements
Environment:
C# 3.0
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01385732
Message ID:
01385732
Vues:
75
Hi to all,
I have a lookup combobox the ItemsSource is populated through a [DataContract] in a WCF Service. The ComboBox has a DisplayMemberPath property (which I use to define which field to show) but does NOT have a ValueMemberPath property (as other Comboboxes do). How, then, can I define the field that shall assign the value of the control? Some people seem to use the ItemsSource property and give it a {Binding}, that seems to work, but as I have to assign these bindings in my code (Completed-Event when the data arrived from the WCF service) how could I do this? Who has done a similar thing before me?

This is my event to populate the ComboBox
private void proxy_GetAllKeyArtikelBestellbarCompleted(object sender, GetAllKeyArtikelBestellbarCompletedEventArgs e)
{
	if (e.Result != null)
	{
		this.cboKeyArtikelBestellbar.ItemsSource = e.Result;
In XAML the Combobox looks like this
<ComboBox Grid.Column="1" Grid.Row="1" 
          x:Name="cboKeyArtikelBestellbar" 
          Width="130" 
          HorizontalAlignment="Left"
          DisplayMemberPath="Bestellbar"
          SelectedItem="{Binding Path=IdKeyArtikelBestellbar}"
          >
But this last attribute (SelectedItem) is not working. Anyway the Item would be a whole set of fields, not just a Binding Path...
How to?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform