Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all.
i have a usercontrol in a wpf priject and used a combobox but the combobox doesn;t show any item.please help me.thanks in advace
this is my xaml code

<combobox grid.column="1" grid.row="1" name="ComboBox_Owner" flowdirection="LeftToRight">
ItemsSource="{Binding Source={StaticResource PersonResource}}" SelectedValue="{Binding Path=Person_ID}"DisplayMemberPath="Family" SelectedValuePath="Person_ID"
Margin="5,4,6,9" Foreground="#FF000086" />
/////////////////////////////////////////////////////////////////////////////////
this is my code behind:


ObservableCollection<personnel> _Person = new ObservableCollection<personnel>();

CollectionViewSource PersonCollection = new CollectionViewSource();

PersonCollection = (CollectionViewSource)this.Resources["PersonResource"];

this._Person = new ObservableCollection<personnel>(from p in this.context.Personnels orderby p.Person_ID select p);

PersonCollection.Source = _Person;

What I have tried:

i have set combobox itemsource to a list a query and.. but it did'nt work
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900