This is a migrated thread and some comments may be shown as answers.

Large number of distinct values in DistinctFilter

1 Answer 28 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Buzz
Top achievements
Rank 1
Buzz asked on 19 Dec 2013, 03:09 AM
I am programmatically filtering my gridview.  The gridview has about 2000 rows, with a column called "Tag" of type uint that has a unique value for each row.  In another control, my application user can select or unselect the Tags he wants to see in the gridview.

I'm using DistinctFilter as shown below.  I'm seeing very poor performance and even a stackoverflow apparently coming from ResumeNotifications (no stack trace is available for that).
When the user wants to show all 2000 rows, no filtering is needed so that works fine.  But when a single row is to be filtered out, I would AddDistinctValue 1999 times.
Is there some better way I should be doing this?   

GridViewColumn tagColumn = this.gridView.Columns["Tag"];
IColumnFilterDescriptor tagFilter = tagColumn.ColumnFilterDescriptor;
 
// Suspend the notifications to avoid multiple data engine updates
tagFilter.SuspendNotifications();
                 
tagFilter.DistinctFilter.Clear();
 
foreach (var pair in myDictionary)
{
    if (pair.Value.IsShown)
    {
        tagFilter.DistinctFilter.AddDistinctValue(pair.Key);
    }
}
 
// Resume the notifications to force the data engine to update the filter.
tagFilter.ResumeNotifications();

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 19 Dec 2013, 11:20 AM
Hello,

Would be please try setting the OptimizeDistinctFilterQuery="True" for the "Tag" column? 

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Buzz
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or