Completed
Last Updated: 13 Mar 2019 13:38 by ADMIN
Release 2019.1.117
ADMIN
Hristo
Created on: 30 Aug 2018 09:43
Category: GridView
Type: Bug Report
0
FIX. RadGridView - the performance of the search row needs to be improved
How to reproduce: bind the grid using the code snippet below and enter name in the SearchRow
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
    public RadForm1()
    {
        InitializeComponent();

        this.radGridView1.DataSource = this.GetData();
        this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
        this.radGridView1.AllowSearchRow = true;

        this.radGridView1.MasterView.TableSearchRow.InitialSearchResultsTreshold = 0;
        this.radGridView1.MasterView.TableSearchRow.SearchResultsGroupSize = int.MaxValue;;
    }

    private DataTable GetData()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Id", typeof(int));
        dt.Columns.Add("Name", typeof(string));
        dt.Columns.Add("Date", typeof(DateTime));
        dt.Columns.Add("Bool", typeof(bool));
        dt.Columns.Add("Description", typeof(string));
        for (int i = 0; i < 2000; i++)
        {
            for (int j = 0; j < 5; j++)
            {
                dt.Rows.Add(i, "Name " + j, DateTime.Now.AddDays(i), i % 2 == 0 , "Description " + i);
            }
        }

        return dt;
    }
}

Workaround: in the search row, set the InitialSearchResultsTreshold property to 0 and the SearchResultsGroupSize property to int.MaxValue
public RadForm1()
{
    InitializeComponent();

    this.radGridView1.DataSource = this.GetData();
    this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
    this.radGridView1.AllowSearchRow = true;

    this.radGridView1.MasterView.TableSearchRow.SearchProgressChanged += TableSearchRow_SearchProgressChanged;
    this.radGridView1.MasterView.TableSearchRow.InitialSearchResultsTreshold = 0;
    this.radGridView1.MasterView.TableSearchRow.SearchResultsGroupSize = int.MaxValue;
}
1 comment
ADMIN
Hristo
Posted on: 19 Sep 2018 08:40
Not really an issue. The grid needs to be invoked while searching to avoid a cross thread exception. The performance can be influenced and improved by setting the InitialSearchResultsTreshold and SearchResultsGroupSize  properties:

this.radGridView1.MasterView.TableSearchRow.InitialSearchResultsTreshold = 1;
this.radGridView1.MasterView.TableSearchRow.SearchResultsGroupSize = int.MaxValue;