私の質問は、エンティティの関連項目を並べ替える方法です。請求書の編集]ウィンドウで Entity Framework - リレーションプロパティを並べ替える
、私は1つのComboBoxの表示すべての顧客を持っている:XAML:
<UserControl.Resources>
<CollectionViewSource x:Key="cvsCustomers"
d:DesignSource="{d:DesignInstance local:Customer, CreateList=True}" />
...
</UserControl.Resources>
<ComboBox ItemsSource="{Binding Source={StaticResource cvsCustomers}}" .../>
コードビハインド:
Dim cvsCustomers As System.Windows.Data.CollectionViewSource
cvsCustomers = CType(Me.FindResource("cvsCustomers"), System.Windows.Data.CollectionViewSource)
Dim qryCustomers = _
From c In myEntities.Customers _
Order By c.CustomerCode
Select c
cvsCustomers.Source = qryCustomers
は今、私はすべて表示する第二コンボボックスを持っています選択された顧客の連絡先。これはうまく動作しますが、この2番目のComboBoxのエントリはIDによってソートされていないかソートされています。
XAML:
<ComboBox ItemsSource="{Binding Path=myInvoice.Customer.Contacts}" .../>
。
第2コンボボックスのリストをソートするにはどうすればよいですか?
キングについて、ヒント/提案のため事前に と感謝、
ニコ
オーケーおかげでたくさん、私はできるだけ早くこれを試してみましょう:=) – Nico
はcontext.Entry(インスタンス) 'タートル...として遅い'、注意してください:) –