wpf-401355-controls-and-libraries-data-grid-filtering-and-searching-data-analysis-filters.md
The GridControl allows you to apply Data Analysis Filters - numerical filters that do not have corresponding comparison operators.
The following data analysis filters are available:
Displays a specific number of topmost/bottom-most values. You can specify this number as an absolute or percentage value.
Displays values that are above/below an average value.
Displays unique/duplicate values.
Select data analysis filters in the Filter Editor:
Select data analysis filters in the Excel-style Drop-down Filter:
Use the DataControlBase.FilterString property to apply data analysis filters in code:
grid.FilterString = "[#TopItems]([Profit], 10)"; // Profit in Top 10 Items
grid.FilterString = "[#TopPercent]([Profit], 10)"; // Profit in Top 10%
grid.FilterString = "[#BottomItems]([Profit], 10)"; // Profit in Bottom 10 Items
grid.FilterString = "[#BottomPercent]([Profit], 10)"; // Profit in Bottom 10%
grid.FilterString = "[#AboveAverage]([Profit])"; // Profit Above Average
grid.FilterString = "[#BelowAverage]([Profit])"; // Profit Below Average
grid.FilterString = "[#Unique]([Profit])"; // Profit is Unique
grid.FilterString = "[#Duplicate]([Profit])"; // Profit is Duplicate
grid.FilterString = "[#TopItems]([Profit], 10)" 'Profit in Top 10 Items
grid.FilterString = "[#TopPercent]([Profit], 10)" 'Profit in Top 10%
grid.FilterString = "[#BottomItems]([Profit], 10)" 'Profit in Bottom 10 Items
grid.FilterString = "[#BottomPercent]([Profit], 10)" 'Profit in Bottom 10%
grid.FilterString = "[#AboveAverage]([Profit])" 'Profit Above Average
grid.FilterString = "[#BelowAverage]([Profit])" 'Profit Below Average
grid.FilterString = "[#Unique]([Profit])" 'Profit is Unique
grid.FilterString = "[#Duplicate]([Profit])" 'Profit is Duplicate
You can also use the DataControlBase.FilterCriteria property:
grid.FilterCriteria = new FunctionOperator("#TopItems", new OperandProperty("Profit"), new OperandValue(10)); // Profit in Top 10 Items
grid.FilterCriteria = new FunctionOperator("#TopPercent", new OperandProperty("Profit"), new OperandValue(10)); // Profit in Top 10%
grid.FilterCriteria = new FunctionOperator("#BottomItems", new OperandProperty("Profit"), new OperandValue(10)); // Profit in Bottom 10 Items
grid.FilterCriteria = new FunctionOperator("#BottomPercent", new OperandProperty("Profit"), new OperandValue(10)); // Profit in Bottom 10%
grid.FilterCriteria = new FunctionOperator("#AboveAverage", new OperandProperty("Profit")); // Profit Above Average
grid.FilterCriteria = new FunctionOperator("#BelowAverage", new OperandProperty("Profit")); // Profit Below Average
grid.FilterCriteria = new FunctionOperator("#Unique", new OperandProperty("Profit")); // Profit is Unique
grid.FilterCriteria = new FunctionOperator("#Duplicate", new OperandProperty("Profit")); // Profit is Duplicate
grid.FilterCriteria = New FunctionOperator("#TopItems", New OperandProperty("Profit"), New OperandValue(10)) 'Profit in Top 10 Items
grid.FilterCriteria = New FunctionOperator("#TopPercent", New OperandProperty("Profit"), New OperandValue(10)) 'Profit in Top 10%
grid.FilterCriteria = New FunctionOperator("#BottomItems", New OperandProperty("Profit"), New OperandValue(10)) 'Profit in Bottom 10 Items
grid.FilterCriteria = New FunctionOperator("#BottomPercent", New OperandProperty("Profit"), New OperandValue(10)) 'Profit in Bottom 10%
grid.FilterCriteria = New FunctionOperator("#AboveAverage", New OperandProperty("Profit")) 'Profit Above Average
grid.FilterCriteria = New FunctionOperator("#BelowAverage", New OperandProperty("Profit")) 'Profit Below Average
grid.FilterCriteria = New FunctionOperator("#Unique", New OperandProperty("Profit")) 'Profit is Unique
grid.FilterCriteria = New FunctionOperator("#Duplicate", New OperandProperty("Profit")) 'Profit is Duplicate