Hi Team,
The RadGridView performs very poorly when you sort by a column with non unique values and select many rows. The UI thread gets stuck and it takes a while for it to come back, which causes issues with updates or other user operations following it. Our test was done on 50,000 rows.
To reproduce:
1. Bind RadGridView ItemsSource to a collection with 50,000 items. Set selection mode to Extended. Make one values of one property unique and the other constant.
2. Run the sample and sort by the column with constant value.
3. Select all rows in the grid (CTRL+A)
4. Click on any row on the grid to verify that Dispatcher thread is locked.
Note that if grid is sorted by unique value column same operation is fairly fast.
See below for the sample view, code behind and VM to reproduce this issue.
The RadGridView performs very poorly when you sort by a column with non unique values and select many rows. The UI thread gets stuck and it takes a while for it to come back, which causes issues with updates or other user operations following it. Our test was done on 50,000 rows.
To reproduce:
1. Bind RadGridView ItemsSource to a collection with 50,000 items. Set selection mode to Extended. Make one values of one property unique and the other constant.
2. Run the sample and sort by the column with constant value.
3. Select all rows in the grid (CTRL+A)
4. Click on any row on the grid to verify that Dispatcher thread is locked.
Note that if grid is sorted by unique value column same operation is fairly fast.
See below for the sample view, code behind and VM to reproduce this issue.
<
Window
x:Class
=
"VariousDataSources.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
>
<
Window.Resources
>
</
Window.Resources
>
<
telerik:RadGridView
x:Name
=
"RadGridView1"
GroupRenderMode
=
"Flat"
AutoGenerateColumns
=
"True"
RowIndicatorVisibility
=
"Collapsed"
CanUserFreezeColumns
=
"False"
ItemsSource
=
"{Binding DataSource}"
SelectionMode
=
"Extended"
>
</
telerik:RadGridView
>
</
Window
>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
DataContext = new MyModel();
}
}
public class MyRow
{
public int SlowColumn { get; set; }
public int FastColumn { get; set; }
}
public class MyModel : ViewModelBase
{
public MyModel()
{
DataSource = new ObservableCollection<
MyRow
>();
for (var i = 0; i <
50000
; i++)
{
var
row
=
new
MyRow();
row.SlowColumn
=
1
;
row.FastColumn
=
i
;
DataSource.Add(row);
}
}
public ObservableCollection<MyRow> DataSource { get; set; }
}