How to filter one source to three different set using RIA?
I defined a DomainData开发者_JAVA技巧Source in the XAML:
<dds:DomainDataSource x:Name="ddsPayroll" QueryName="GetEnPrcsQ" AutoLoad="True" LoadSize="20" PageSize="20">
<dds:DomainDataSource.DomainContext>
<RIASrv:PayrollSrv />
</dds:DomainDataSource.DomainContext>
<dds:DomainDataSource.SortDescriptors>
<filter:SortDescriptor Direction="Descending" PropertyPath="wProcessId" />
</dds:DomainDataSource.SortDescriptors>
</dds:DomainDataSource>
In the record set returned, there is a column named "status".
I have 3 different listbox controls.
I need to assign status=1
in listbox1
, status=2
in listbox2
, and status=3
in listbox3
. Is there any way to do this in XAML?
You can use three CollectionViewSource objects. Each one of them should have its Source property bound to the DataView property of the DomainDataSource. For each CollectionViewSource you will create a Filter delegate that will filter out the appropriate items for each one of your listboxes.
精彩评论