Hi,
I have a simple grid defined like this:
The data is initiated like this:
When I add sorting to the grid (as seen in the xaml above) the grid on first load displays both the 20 orders that should be in the grid and the 20 orders that should have been in the grid if there was no initial sorting defined. When I step to the next page and then back again to the first page, only the 20 orders that should be in the grid remains.
So for instance, the orders in the grid on the first page might initialy be:
1, 2, 3, ..., 20, 100, 99, 98, ..., 81
But it should be:
100, 99, 98, ..., 81
Am I doing something wrong, or is this a bug?
Best regards
Linus
I have a simple grid defined like this:
<
telerik:RadGridView
Name
=
"OrdersGridView"
SelectionMode
=
"Single"
ItemsSource
=
"{Binding PagedSource, ElementName=OrdersPager}"
AutoGenerateColumns
=
"False"
ShowInsertRow
=
"True"
UseLayoutRounding
=
"False"
CanUserDeleteRows
=
"False"
RowEditEnded
=
"OrdersGridViewRowEditEnded"
AddingNewDataItem
=
"OrdersGridViewAddingNewDataItem"
>
<
telerik:RadGridView.SortDescriptors
>
<
telerik:SortDescriptor
Member
=
"Id"
SortDirection
=
"Descending"
/>
</
telerik:RadGridView.SortDescriptors
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Id}"
Header
=
"{x:Static properties:Resources.Id}"
UniqueName
=
"Id"
IsReadOnly
=
"True"
/>
<
telerik:GridViewComboBoxColumn
DataMemberBinding
=
"{Binding status}"
Header
=
"{x:Static properties:Resources.Status}"
UniqueName
=
"Status"
ItemsSource
=
"{Binding Statuses}"
SelectedValueMemberPath
=
"Key"
DisplayMemberPath
=
"Value"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding SocialSecurityNumber}"
Header
=
"{x:Static properties:Resources.SocialSecurityNumber}"
UniqueName
=
"SocialSecurityNumber"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding VisitDate}"
Header
=
"{x:Static properties:Resources.VisitDate}"
UniqueName
=
"VisitDate"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Department}"
Header
=
"{x:Static properties:Resources.Department}"
UniqueName
=
"Department"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Information}"
Header
=
"{x:Static properties:Resources.Information}"
UniqueName
=
"Information"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Recipient}"
Header
=
"{x:Static properties:Resources.Recipient}"
UniqueName
=
"Recipient"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding OrderDate}"
Header
=
"{x:Static properties:Resources.OrderDate}"
UniqueName
=
"OrderDate"
DataFormatString
=
"{} {0:yyyy-MM-dd}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding OrderedBy}"
Header
=
"{x:Static properties:Resources.OrderedBy}"
UniqueName
=
"OrderedBy"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ContactEmail}"
Header
=
"{x:Static properties:Resources.Email}"
UniqueName
=
"Email"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ContactPhone}"
Header
=
"{x:Static properties:Resources.Phone}"
UniqueName
=
"Phone"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding DocumentId}"
Header
=
"{x:Static properties:Resources.DocumentId}"
UniqueName
=
"DocumentId"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding LoanDate}"
Header
=
"{x:Static properties:Resources.LoanDate}"
UniqueName
=
"LoanDate"
DataFormatString
=
"{} {0:yyyy-MM-dd}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding LoanProcessedBy}"
Header
=
"{x:Static properties:Resources.LoanProcessedBy}"
UniqueName
=
"LoanProcessedBy"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ReturnDate}"
Header
=
"{x:Static properties:Resources.ReturnDate}"
UniqueName
=
"ReturnDate"
DataFormatString
=
"{} {0:yyyy-MM-dd}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ReturnProcessedBy}"
Header
=
"{x:Static properties:Resources.ReturnProcessedBy}"
UniqueName
=
"ReturnProcessedBy"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
<
telerik:RadDataPager
Grid.Row
=
"1"
Name
=
"OrdersPager"
Source
=
"{Binding Path=Orders}"
DisplayMode
=
"First, Previous, Next, Last, Text"
IsTotalItemCountFixed
=
"True"
/>
The data is initiated like this:
Orders =
new
QueryableDataServiceCollectionView<Order>(ordersContext, ordersQuery) { PageSize = 20, AutoLoad =
true
};
When I add sorting to the grid (as seen in the xaml above) the grid on first load displays both the 20 orders that should be in the grid and the 20 orders that should have been in the grid if there was no initial sorting defined. When I step to the next page and then back again to the first page, only the 20 orders that should be in the grid remains.
So for instance, the orders in the grid on the first page might initialy be:
1, 2, 3, ..., 20, 100, 99, 98, ..., 81
But it should be:
100, 99, 98, ..., 81
Am I doing something wrong, or is this a bug?
Best regards
Linus