Experience Seamless Excel-Like Filtering in WinUI DataGrid 
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (172).NET Core  (29).NET MAUI  (164)Angular  (100)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (195)BoldSign  (11)DocIO  (24)Essential JS 2  (104)Essential Studio  (195)File Formats  (59)Flutter  (127)JavaScript  (215)Microsoft  (118)PDF  (79)Python  (1)React  (95)Streamlit  (1)Succinctly series  (130)Syncfusion  (810)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (48)Windows Forms  (59)WinUI  (65)WPF  (151)Xamarin  (160)XlsIO  (32)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (142)Chart  (107)Cloud  (14)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (61)Development  (573)Doc  (7)DockingManager  (1)eBook  (98)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (33)Extensions  (22)File Manager  (6)Gantt  (17)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (447)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (37)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (11)Scheduler  (50)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (29)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (320)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (28)Visual Studio Code  (17)Web  (532)What's new  (287)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Experience Seamless Excel-Like Filtering in WinUI DataGrid

Experience Seamless Excel-Like Filtering in WinUI DataGrid 

Filtering is one of the most necessary features of any data grid. With it, users can find the data they require from a huge volume of data sets by applying criteria.

The WinUI DataGrid control is used to display and manipulate tabular data efficiently. Its rich feature set includes data binding, editing, sorting, filtering, grouping, and data virtualization. It has been optimized to work with millions of records and handle high-frequency, real-time updates.

It also provides Excel-like filtering support to filter the rows more intuitively.

In this blog, we will see the various Excel-like filtering options available in the WinUI DataGrid.

Getting started with Excel-like filtering

We can enable Excel-like filtering support for all columns by setting the SfDataGrid.AllowFiltering property to true. The filter icon will be shown in the column headers.

Refer to the following image.

Enabling Excel-Like Filtering in WinUI DataGrid
Enabling Excel-Like Filtering in WinUI DataGrid

By clicking on the filter icon, you can see the Excel-like pop-up menu, as shown in the following image.

WinUI DataGrid with Excel-Like Filtering Pop-Up
WinUI DataGrid with Excel-Like Filtering Pop-Up

Features of Excel-like filtering in WinUI DataGrid

The Excel-like filtering support in our WinUI DataGrid has almost all the options available in the Microsoft Excel filtering menu:

  • Sorting: Easily sort the rows in ascending or descending order.
  • Clear filter: Clear the current filter applied to the column.
  • Advanced filtering.
  • Checkbox filtering.

Let’s look at the latter two options in more detail.

Advanced filtering

With advanced filtering, users can filter for the required data by applying multiple filter conditions with filter criteria. Each type of filter has its own set of filter conditions to apply filtering with ease.

The advanced filtering options are available based on the data type of the columns.

Supported data types:

  • Text
  • Number
  • Date

The following table shows the list of filter conditions supported in advanced filter options.




· Equals

· Does Not Equal

· Begins With

· Does Not Begin With

· Ends With

· Does Not End With

· Contains

· Does Not Contain

· Empty

· Not Empty

· Null

· Not Null

· Equals

· Does Not Equal

· Null

· Not Null

· Less Than

· Less Than or Equal

· Greater Than

· Greater Than or Equal

· Equals

· Does Not Equal

· Before

· Before Or Equal

· After

· After or Equal

· Null

· Not Null

You can also choose whether the AND or OR logical operator should be applied between the two filter conditions you apply in the advanced filter.

Refer to the following GIF image.

Advanced Filtering Support in WinUI DataGrid
Advanced Filtering Support in WinUI DataGrid

Checkbox filtering

Checkboxes are the most common filtering option used to filter rows. By using a checked ListBox in the filter pop-up, you can easily select the data you want to view.  A blank item is added automatically if the column has null or empty data.

Checkbox Filtering Support in WinUI DataGrid
Checkbox Filtering Support in WinUI DataGrid


The following events will be called when we apply filtering through the Excel-like filter pop-up:

  • FilterChanging: This is invoked while applying filtering to a specific column.
  • FilterChanged: This is invoked after the filtering is applied to a specific column.
  • FilterItemsPopulating: This is invoked while populating a list of items in the checked list box.
  • FilterItemsPopulated: This is invoked after the list of items in the checked list boxes is populated.

Programmatic filtering

Along with the Excel-like filtering UI, you can also filter data programmatically through:

  • View filtering
  • Column filtering

View filtering

This feature enables users to apply logic to an entire row. This approach requires a bool return type method with an underlying data object as the parameter. This user-defined method will be called for every row in the DataGrid, and the user can return true or false based on the logic. If the return value is true, then that row will be filtered. Other rows will not be displayed in the view.

View filtering can be achieved by setting the SfDataGrid.View.Filter delegate. You can refresh the view by calling the SfDataGrid.View.RefreshFiltermethod.

Refer to the following code example.

public bool FilterRecords(object data)
    string filterText = "Germany";
    var item = data as OrderInfo;

    if (item != null)
        if (item.Country.Equals(filterText))
            return true;
    return false;

private void Button_Click(object sender, RoutedEventArgs e)
    if (sfDataGrid != null && sfDataGrid.View != null)
    	sfDataGrid.View.Filter = FilterRecords;

Refer to the following image.

View Filtering in WinUI DataGrid
View Filtering in WinUI DataGrid

Column filtering

This approach enables users to apply the filter conditions based on specific columns. So, rows will be filtered based on the specific column criteria.

Column filtering can be done using the GridColumn.FilterPredicates property by adding the FilterPredicate to it. You can specify your required criteria in the filter predicate.

In the following example, we will use the OrderID column to filter the data, which has a 1005 value.

sfDataGrid.Columns["OrderID"].FilterPredicates.Add(new FilterPredicate() { FilterType = FilterType.Equals, FilterValue = "1005" });

Refer to the following image.

Programmatic Column Filtering in WinUI DataGrid
Programmatic Column Filtering in WinUI DataGrid


For more details, refer to the Excel-like filtering in the WinUI DataGrid GitHub demo and documentation.


Thanks for reading! I hope you enjoyed this blog about Excel-like filtering in Syncfusion’s WinUI DataGrid control. Try out this user-friendly feature and experience seamless filtering!

For current Syncfusion customers, the newest version of Essential Studio is available from the license and downloads page. If you are not yet a customer, you can try our 30-day free trial to check out these new features.

If you have questions, contact us through our support forumsfeedback portal, or support portal. We are always happy to assist you!

Related blogs


Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed
Scroll To Top