Binding Combobox list objet
Bonjour, j’essaie de faire le binding de ma combobox sur ma liste d'objets, mais rien ne s'affiche. Je sois surement louper quelque chose de simple, mais après quelques recherches je ne vois pas ce qu'il manque.
Merci
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
private List<ADSmsSite> _lstADSmsSite = new List<ADSmsSite>();
List<ADSmsSite> lstADSmsSite { get { return _lstADSmsSite; } set { _lstADSmsSite = value; } }
public MainWindow()
{
InitializeComponent();
this.DataContext = this;
_lstADSmsSite = SCCMSite.GetAllAuthorizedSites(Environment.UserName);
SetDgContent();
} |
XAML
Code:
1 2 3 4 5
|
<ComboBox Height="23" HorizontalAlignment="Left" Margin="155,17,0,0" ItemsSource="{Binding Path=lstADSmsSite}"
SelectedValuePath="MsSMSSiteCode"
DisplayMemberPath="MsSMSSiteCode"
SelectedValue="{Binding Path=lstADSmsSite}" Name="cbSmsMp" VerticalAlignment="Top" Width="120" /> |