We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to filter the records based on display text in the SfDataGrid?

When Advanced Filtering is used in the SfDataGrid, records are filtered based on the actual value, by default. To filter records based on the DisplayText, use the ColumnFilter property in the corresponding column.

In the following grid, the first and second records have the same display value for the Delivery Date column, but the actual values differ (12/02/2010 10:50:23 AM and 12/02/2010 7:30:22 PM).

 

Figure 1: DataGrid with same Delivery Date display value for first and second records

Filtering is applied based on the actual value. So, both values are considered to be different. On opening the filter popup, both values are displayed and seems similar as seen in the following screenshot.

 

Figure 2: Filter pop up when ColumnFilter is Value

When you set the ColumnFilter as DisplayText, only the display value is considered for filtering. The following code example shows how to set the ColumnFilter for a particular column.

XAML

 

When the ColumnFilter is DisplayText, filter popup is shown as follows:

Figure 3: Filter pop when ColumnFilter is DisplayText

After filtering, both the records having the same DisplayText in DeliveryDate column will be displayed like below screenshot.

Figure 4:SfDataGrid after filtering

 

Sample Link:

FilterByDisplayText

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework: Product Version:
4905 05/18/2015 05/19/2015 WPF SfDataGrid 4.5 12.3.0.36
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon