Support Article
Search & sorting with localized values in Data Grid not working
SA-54439
Summary
Grid is displaying localized values for certain columns. For these columns, Sort and Search operations do not work properly.
Error Messages
Not applicable
Steps to Reproduce
- Create a repeating grid populated from a report definition.
- Use control "GetLocalizedValue" for displaying field values for some columns.
- Try to sort one of the localized columns. The sort does not work correctly
- Click the filter icon, and try to filter the column by typing part of a localized value into the Search field. No results are returned.
Root Cause
This issue was determined to be a product enhancement request.
This is a limitation of the current system implementation. The code does not reverse the mapping of the localized (display) value back to the actual value when it does the search, and the database is unaware of the mapping when it does the query to effect the sort, so the results are sorted according to the actual values, not the display values.
Resolution
Perform the following local-change:
Write an alias function to do the mapping of the actual database value to the display value, for example:

This function alias is used as the report definition column instead of the property:

The function is then available to use in the grid:

Because the database is now doing the mapping of the values, it also reverses the mapping when it does a query for a sort or search.
Published July 23, 2018 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.