wpf-18135-controls-and-libraries-spreadsheet-examples-filter-data-how-to-filter-top-or-bottom-ranked-values.md
This example demonstrates how to display the top/bottom ranked values using the "Top 10" filter.
// Enable filtering for the specified cell range.
CellRange range = worksheet["B2:E23"];
worksheet.AutoFilter.Apply(range);
// Apply a filter to the "Sales" column to display the top ten values.
worksheet.AutoFilter.Columns[2].ApplyTop10Filter(Top10Type.Top10Items, 10);
' Enable filtering for the specified cell range.
Dim range As CellRange = worksheet("B2:E23")
worksheet.AutoFilter.Apply(range)
' Apply a filter to the "Sales" column to display the top ten values.
worksheet.AutoFilter.Columns(2).ApplyTop10Filter(Top10Type.Top10Items, 10)