Sorting issue with NULL values in TrDBGrid_MS (UniDAC + Oracle)

6 views
Skip to first unread message

Gyula Rusói

unread,
Feb 11, 2026, 10:51:29 AM (7 days ago) Feb 11
to Rosi Delphi Components

Hi everyone,

I’m using TrDBGrid_MS together with UniDAC and Oracle, and I’ve run into a problem when sorting columns that contain NULL values.

When I click on the column header to sort, the rows with NULL values don’t behave as expected — the ordering becomes inconsistent, and the NULLs don’t appear at the top or bottom in a predictable way.

Has anyone experienced this issue before? Is there a recommended way to handle NULL sorting in TrDBGrid_MS, or do I need to override something manually?

Thanks in advance for any help.

Best regards, Gyula

Tomas Rosinsky

unread,
Feb 11, 2026, 1:00:23 PM (7 days ago) Feb 11
to Rosi Delphi Components
Hi Gyula,

thank you for using my components. 
Sorting itself is not provided by rDBGrid but by used dataset by setting of sorting property. 
As sorting is not defined in base Dataset class and each dataset type can have different sorting functionalities, you can use prepared Sorter component specific for each dataset types, see https://rosinsky.cz/delphi/dbgrid_sorting.html.
So you probably use TrDBGridSorter_UniDAC component defined in rDBGridSorter_UniDac unit.

I'm not sure why sorting with null values does not work correctly, there are two  possible reasons:

1/ wrong setting of sorting property by  TrDBGridSorter_UniDAC - in this case you can modify this unit or implement own descendant of TrDBGridCustomSorter with custom sorting setting
2/ issue in dataset itself - in this case I'm not able to help

Maybe some index refresh could help but hard to say with limited inputs...

I hope it helps and you will find the reason and solution.
Best regards
Tomas


Dne středa 11. února 2026 v 16:51:29 UTC+1 uživatel rus...@gmail.com napsal:
Reply all
Reply to author
Forward
0 new messages