Articles in this section
Category / Section

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

1 min read

When Advanced Filtering is used in the WPF 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

<Syncfusion:GridDateTimeColumn HeaderText="Delivery Date" MappingName="DeliveryDate" ColumnFilter="DisplayText"  />

 

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


Conclusion

I hope you enjoyed learning about how to filter the records based on display text in the WPF SfDataGrid.

You can refer to our WPF SfDataGrid feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF SfDataGrid example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied