Skip to content

Performance delay when filtering a DataTable using the DefaultView.RowFilter property #9503

@SreemonPremkumarMuthukrishnan

Description

Description

When filtering the DataTable using the DefaultView.RowFilter property, it takes a long time (more than 2 minutes) to apply the filter. The number of items being filtered is 5,800. Please find the code snippet below.

Note: The filter string was provided along with the sample.

C# code:

private void FilteringButton_Click(object sender, RoutedEventArgs e)
{
    DataTable dataTable = getDataReturn();
    var filterString = File.ReadAllText(@"..\..\Filterstring.txt");
    dataTable.DefaultView.RowFilter = filterString;
}

Output reference:

DataTable_Filter_Delay_Output.mp4

Sample:

DataTable_Filtering_Demo.zip

Reproduction Steps

  1. Run the sample
  2. Click the "Click to filter" button to filter

Expected behavior

The filter should not take too much time.

Actual behavior

The filtering takes too much time.

Regression?

No response

Known Workarounds

No response

Impact

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions