My DataGridView control currently sorts using the Sort property of the bound data, but it isn’t doing what I want it to do.
I have a column called Employee that is displayed as “Firstname Lastname”.
When I sort by Employee, Amy Z_Lastname is listed before John A_Lastname, meaning I would prefer to sort by last names.
I could break the Employee string up into 3 parts, include those in the DataTable, and set the sort to “Lastname, Firstname”, then hide the Lastname and Firstname columns.
I’d rather learn how to override the default IComparer (or whatever it uses) to provide instructions on how to sort the way I want (the answer I’d prefer).
Custom sorting in the DataGridView
e.g: