Skip to content

SyncfusionExamples/how-to-sort-the-columns-based-on-length-of-the-text-in-Flutter-datagrid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom sorting

The datagrid allows to sort columns based on custom logic. For each column, you can provide different sorting criteria by overriding the following methods from DataGridSource,

  • handleSort : This method will be called when you tap the column header and sorting is being applied. You can override this method to provide the entire logic for sorting for columns.
  • compare : You can override this method to compare two objects and return the sorting order based on the criteria.

Sort columns based on string length

This application shows how to perform custom sorting for the columns based on the string length by overriding the handleSort and compare method.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published