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.
Unfortunately, activation email could not send to your email. Please try again.

How to hide the rows based on condition in SfDataGrid?

In SfDataGrid, you can hide the rows based on some condition by using QueryRowHeight event.

 

The following code example explains how to hide the rows based on condition by setting e.Height to zero.

 

C#

 

When you need to hide/unhide a row at the run time, you can trigger QueryRowHeight event only for particular row by calling SfDataGrid.InvalidateRowHeight and VisualContainer.InvalidateMeasureInfo methods.

 

RowValidating event is triggered while editing a particular row. So that you can change the RowHeight based on edited values by calling SfDataGrid.InvalidateRowHeight and VisualContainer.InvalidateMeasureInfo methods.

 

C#

You can bring the items which are hidden into View when property value changes by invalidating the row height by handling RecordPropertyChanged event.

 

C#

 

 

Sample Links:

 

WPF

WRT

SilverLight

UWP

Article ID: Published Date: Last Revised Date: Platform: Control:
6057 01/22/2016 01/22/2016 UWP SfDataGrid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.