没办法,自己初学者,实在是不知道当我没有用SortDescriptors进行排序的时候我就是在翻页的时候就会报错? Why? 真的是不知道,当我把默认排序加上去的时候就没有任何错误,我不知道是哪里错了,麻烦各位大侠帮帮小弟,
我一翻页就报错,但是我加上那个SortDescriptor 就没有错, 真是头大了
![ContractedBlock.gif](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
<
Grid x:Name
=
"
LayoutRoot
"
Background
=
"
White
"
>
< riaControls:DomainDataSource Name = " domainDataSource1 " QueryName = " GetProducts " AutoLoad = " True " LoadSize = " 10 " PageSize = " 5 " >
< riaControls:DomainDataSource.DomainContext >
< ria:DomainService1 />
</ riaControls:DomainDataSource.DomainContext >
<!--< riaControls:DomainDataSource.SortDescriptors >
< riaControls:SortDescriptor PropertyPath = " ProductID " ></ riaControls:SortDescriptor >
</ riaControls:DomainDataSource.SortDescriptors >-->
</ riaControls:DomainDataSource >
< StackPanel >
< sdk:DataGrid AutoGenerateColumns = " True " Name = " dataGrid1 " ItemsSource = " {Binding Data,ElementName=domainDataSource1} " >
</ sdk:DataGrid >
< sdk:DataPager Name = " myDataPager " Source = " {Binding Data,ElementName=domainDataSource1} " />
</ StackPanel >
</ Grid >
< riaControls:DomainDataSource Name = " domainDataSource1 " QueryName = " GetProducts " AutoLoad = " True " LoadSize = " 10 " PageSize = " 5 " >
< riaControls:DomainDataSource.DomainContext >
< ria:DomainService1 />
</ riaControls:DomainDataSource.DomainContext >
<!--< riaControls:DomainDataSource.SortDescriptors >
< riaControls:SortDescriptor PropertyPath = " ProductID " ></ riaControls:SortDescriptor >
</ riaControls:DomainDataSource.SortDescriptors >-->
</ riaControls:DomainDataSource >
< StackPanel >
< sdk:DataGrid AutoGenerateColumns = " True " Name = " dataGrid1 " ItemsSource = " {Binding Data,ElementName=domainDataSource1} " >
</ sdk:DataGrid >
< sdk:DataPager Name = " myDataPager " Source = " {Binding Data,ElementName=domainDataSource1} " />
</ StackPanel >
</ Grid >