I have a grid with about 20 columns (most of them are combobox and DateTime) and there also a data pager attached to grid.
We set AlternationCount to "2" in order to highlight every 2nd row.
Before everything was ok, but when we switched to build 2011.1.419, grid is showing the new page extremely slow (up to 10 seconds to switch to the new page) when switching pages in data pager.
Here's a simple code to reproduce this:
Note: When you set "AlternationCount = 0" everything is ok.
We set AlternationCount to "2" in order to highlight every 2nd row.
Before everything was ok, but when we switched to build 2011.1.419, grid is showing the new page extremely slow (up to 10 seconds to switch to the new page) when switching pages in data pager.
Here's a simple code to reproduce this:
<
UserControl
x:Class
=
"TelerikTest.MainPage"
xmlns:radGrid
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
xmlns:telerik
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Data"
xmlns:radInput
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
radGrid:RadGridView
Grid.Row
=
"0"
x:Name
=
"RadGridView1"
AutoGenerateColumns
=
"False"
ScrollMode
=
"Deferred"
DataLoadMode
=
"Synchronous"
AlternationCount
=
"2"
>
<
radGrid:RadGridView.Columns
>
<
radGrid:GridViewDataColumn
UniqueName
=
"Id"
DataMemberBinding
=
"{Binding Path=Id, Mode=TwoWay}"
Header
=
"Id"
IsReadOnly
=
"False"
IsGroupable
=
"True"
Width
=
"Auto"
IsVisible
=
"True"
/>
<
radGrid:GridViewDataColumn
UniqueName
=
"Property1"
DataMemberBinding
=
"{Binding Path=Property1, Mode=TwoWay}"
Header
=
"Property 1"
IsReadOnly
=
"False"
IsGroupable
=
"True"
Width
=
"Auto"
IsVisible
=
"True"
>
<
radGrid:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
radInput:RadDatePicker
IsEnabled
=
"False"
SelectedDate
=
"{Binding Path=Property1, Mode=TwoWay}"
/>
</
DataTemplate
>
</
radGrid:GridViewDataColumn.CellTemplate
>
</
radGrid:GridViewDataColumn
>
<
radGrid:GridViewDataColumn
UniqueName
=
"Property2"
DataMemberBinding
=
"{Binding Path=Property2, Mode=TwoWay}"
Header
=
"Property 2"
IsReadOnly
=
"False"
IsGroupable
=
"True"
Width
=
"Auto"
IsVisible
=
"True"
>
<
radGrid:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
radInput:RadDatePicker
IsEnabled
=
"False"
SelectedDate
=
"{Binding Path=Property2, Mode=TwoWay}"
/>
</
DataTemplate
>
</
radGrid:GridViewDataColumn.CellTemplate
>
</
radGrid:GridViewDataColumn
>
<
radGrid:GridViewDataColumn
UniqueName
=
"Property3"
DataMemberBinding
=
"{Binding Path=Property3, Mode=TwoWay}"
Header
=
"Property 3"
IsReadOnly
=
"False"
IsGroupable
=
"True"
Width
=
"Auto"
IsVisible
=
"True"
>
<
radGrid:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
radInput:RadDatePicker
IsEnabled
=
"False"
SelectedDate
=
"{Binding Path=Property3, Mode=TwoWay}"
/>
</
DataTemplate
>
</
radGrid:GridViewDataColumn.CellTemplate
>
</
radGrid:GridViewDataColumn
>
<
radGrid:GridViewDataColumn
UniqueName
=
"Property4"
DataMemberBinding
=
"{Binding Path=Property4, Mode=TwoWay}"
Header
=
"Property 4"
IsReadOnly
=
"False"
IsGroupable
=
"True"
Width
=
"Auto"
IsVisible
=
"True"
>
<
radGrid:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
radInput:RadDatePicker
IsEnabled
=
"False"
SelectedDate
=
"{Binding Path=Property4, Mode=TwoWay}"
/>
</
DataTemplate
>
</
radGrid:GridViewDataColumn.CellTemplate
>
</
radGrid:GridViewDataColumn
>
<
radGrid:GridViewDataColumn
UniqueName
=
"Property5"
DataMemberBinding
=
"{Binding Path=Property5, Mode=TwoWay}"
Header
=
"Property 5"
IsReadOnly
=
"False"
IsGroupable
=
"True"
Width
=
"Auto"
IsVisible
=
"True"
>
<
radGrid:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
radInput:RadDatePicker
IsEnabled
=
"False"
SelectedDate
=
"{Binding Path=Property5, Mode=TwoWay}"
/>
</
DataTemplate
>
</
radGrid:GridViewDataColumn.CellTemplate
>
</
radGrid:GridViewDataColumn
>
<
radGrid:GridViewDataColumn
UniqueName
=
"Property6"
DataMemberBinding
=
"{Binding Path=Property6, Mode=TwoWay}"
Header
=
"Property 6"
IsReadOnly
=
"False"
IsGroupable
=
"True"
Width
=
"Auto"
IsVisible
=
"True"
>
<
radGrid:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
radInput:RadDatePicker
IsEnabled
=
"False"
SelectedDate
=
"{Binding Path=Property6, Mode=TwoWay}"
/>
</
DataTemplate
>
</
radGrid:GridViewDataColumn.CellTemplate
>
</
radGrid:GridViewDataColumn
>
<
radGrid:GridViewDataColumn
UniqueName
=
"Property7"
DataMemberBinding
=
"{Binding Path=Property7, Mode=TwoWay}"
Header
=
"Property 7"
IsReadOnly
=
"False"
IsGroupable
=
"True"
Width
=
"Auto"
IsVisible
=
"True"
>
<
radGrid:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
radInput:RadDatePicker
IsEnabled
=
"False"
SelectedDate
=
"{Binding Path=Property7, Mode=TwoWay}"
/>
</
DataTemplate
>
</
radGrid:GridViewDataColumn.CellTemplate
>
</
radGrid:GridViewDataColumn
>
<
radGrid:GridViewDataColumn
UniqueName
=
"Property8"
DataMemberBinding
=
"{Binding Path=Property8, Mode=TwoWay}"
Header
=
"Property 8"
IsReadOnly
=
"False"
IsGroupable
=
"True"
Width
=
"Auto"
IsVisible
=
"True"
>
<
radGrid:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
radInput:RadDatePicker
IsEnabled
=
"False"
SelectedDate
=
"{Binding Path=Property8, Mode=TwoWay}"
/>
</
DataTemplate
>
</
radGrid:GridViewDataColumn.CellTemplate
>
</
radGrid:GridViewDataColumn
>
<
radGrid:GridViewDataColumn
UniqueName
=
"Property9"
DataMemberBinding
=
"{Binding Path=Property9, Mode=TwoWay}"
Header
=
"Property 9"
IsReadOnly
=
"False"
IsGroupable
=
"True"
Width
=
"Auto"
IsVisible
=
"True"
>
<
radGrid:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
radInput:RadDatePicker
IsEnabled
=
"False"
SelectedDate
=
"{Binding Path=Property9, Mode=TwoWay}"
/>
</
DataTemplate
>
</
radGrid:GridViewDataColumn.CellTemplate
>
</
radGrid:GridViewDataColumn
>
</
radGrid:RadGridView.Columns
>
</
radGrid:RadGridView
>
<
telerik:RadDataPager
PageSize
=
"20"
Grid.Row
=
"1"
Source
=
"{Binding Items, ElementName=RadGridView1}"
IsTotalItemCountFixed
=
"True"
DisplayMode
=
"FirstLastPreviousNextNumeric, Text"
/>
</
Grid
>
</
UserControl
>
using
System;
using
System.Collections.Generic;
using
Telerik.Windows.Data;
namespace
TelerikTest
{
public
partial
class
MainPage
{
public
MainPage()
{
InitializeComponent();
List<MyObject> source =
new
List<MyObject>();
for
(
int
i = 1; i <= 100; i++ )
{
source.Add(
new
MyObject
{
Id = Guid.NewGuid(),
Property1 = DateTime.Now,
Property2 = DateTime.Now,
Property3 = DateTime.Now,
Property4 = DateTime.Now,
Property5 = DateTime.Now,
Property6 = DateTime.Now,
Property7 = DateTime.Now,
Property8 = DateTime.Now,
Property9 = DateTime.Now,
});
}
RadGridView1.ItemsSource =
new
QueryableCollectionView(source);
}
}
public
class
MyObject : IComparable, IComparable<MyObject>
{
public
Guid Id {
get
;
set
; }
public
DateTime Property1 {
get
;
set
; }
public
DateTime Property2 {
get
;
set
; }
public
DateTime Property3 {
get
;
set
; }
public
DateTime Property4 {
get
;
set
; }
public
DateTime Property5 {
get
;
set
; }
public
DateTime Property6 {
get
;
set
; }
public
DateTime Property7 {
get
;
set
; }
public
DateTime Property8 {
get
;
set
; }
public
DateTime Property9 {
get
;
set
; }
public
override
bool
Equals(
object
obj)
{
MyObject obj2 = obj
as
MyObject;
return
(obj2 ==
null
?
false
: obj2.Id.Equals(Id));
}
public
override
int
GetHashCode()
{
return
Id.GetHashCode();
}
public
virtual
int
CompareTo(
object
obj)
{
return
CompareTo(obj
as
MyObject);
}
public
virtual
int
CompareTo(MyObject other)
{
return
other ==
null
? 1 : Id.CompareTo(other.Id);
}
}
}
Note: When you set "AlternationCount = 0" everything is ok.