-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorting in data grid respecting the culture specific sorting rules. #154
Comments
Hey @OndrejUzovic , Maybe it will be better if we pass the current application culture instead exposing a property: Not sure however how this will affect database sorting - should remain the same (performed by the database). |
Hi @enchev , thanks for your response. The problem with the CurrentCulture is that it would be difficult (maybe impossible) to use in cases if you have multiple users with different cultures (each user wants to see the column ordered according to his culture rules). However the problem seems a bit more complex that I thought when I wrote my original proposal. The problem is, it is not enough to just expose the property for IComparer because the comparer would just get the whole TItem and would not know which column(s) shall be compared. The implementation of IComparer would have to store the reference to DataGrid and then use Query.OrderBy to resolve that - which seems somehow complex for a general solution. So finally I came to the idea that maybe better than IComparer will be to expose CultureInfo in DataGrid. The culture specific string comparer would be created internally by DataGrid and used only if string columns shall be sorted. Here is my final workaround solution which reflex this idea and I am currently using:
|
Note that using I've made a feature request here to actually have a
I'd leave the database ordering as is (performed by the database, or whatever provider you use), you typically use the database collation for those effects. |
Currently when data grid sorts text columns containing a string with diacritics, it displays it in incorrect order because it does not respect the culture specific sorting rules.
The solution for this problem could be to provide a 'Parameter' property Comparer (of type System.Collections.IComparer) into the data grid.
If the property is set then the comparer would be used in RadzenGrid.View as the second parameter when OrderBy(..) is called.
Would you please consider this feature?
The text was updated successfully, but these errors were encountered: