Completed
Last Updated: 09 Nov 2021 10:13 by ADMIN
Release R3 2021 SP1
n/a
Created on: 29 Oct 2021 14:28
Category: GridView
Type: Bug Report
1
RadGridView: Memory leak when search row is visible and the control is rebind multiple times

To reproduce, rebind the grid to a data table on button click and show grid's search row.

public RadForm1()
{
    InitializeComponent();
    this.radGridView1.AllowSearchRow = true;
}

private void RadButton1_Click()
{
    DataTable dt = this.GetData();
    this.radGridView1.DataSource = dt;
}
private DataTable GetData()
{
    DataTable data = new DataTable();
    for (int i = 0; i < 5; i++)
    {
        data.Columns.Add("Column " + i, typeof(int));
        data.Columns.Add("Column " + i + 1, typeof(string));
        data.Columns.Add("Column " + i + 2, typeof(string));
    }

    for (int k = 0; k < 5000; k++)
    {
        object[] parameters = new object[15];
        for (int i = 0; i < 15; i += 3)
        {
            parameters[i] = k;
            parameters[i + 1] = "Text " + i;
            parameters[i + 2] = "Text " + i + 1;
        }

        data.Rows.Add(parameters);
    }

    return data;
}

0 comments