DBGRid sorting with null value

63 views
Skip to first unread message

penj...@gmail.com

unread,
Jun 29, 2020, 5:03:46 AM6/29/20
to Rosi Delphi Components
i have rdbgid_ms and activate sorting in header, when i sorting by null value it shows
firedac stan eval 114 excpected [')']
regards

penj...@gmail.com

unread,
Jun 29, 2020, 6:51:50 AM6/29/20
to Rosi Delphi Components
my mistake, Problem is filtering by null not sorting

penj...@gmail.com

unread,
Jun 29, 2020, 9:11:01 AM6/29/20
to Rosi Delphi Components
i found solution:

SetColumnFilter(Sender: TObject;
  DataSet: TDataSet; Field: TField; FilterString: string; FilterForm: TForm);
begin
   FilterString:=StringReplace(FilterString,'= )','is null)',[rfReplaceAll]);
   DataSet.Filter:=FilterString;
   DataSet.Filtered:=true;
   FilterForm.Close
end;

Tomas Rosinsky

unread,
Jun 29, 2020, 4:06:11 PM6/29/20
to Rosi Delphi Components
Hello,
condition used for comparison of null value depends on used dataset type and therefore can be set by global configuration defined in the RosiCompGlobalCfg:

In your case it can be set as follows:
RosiCompConfig.rDBFilterCfg.NullEqualStr:='IS';

Then funnel filter should work also for NULL value. Text filter does not support null value as it cannot be entered.

I hope it helps
Tomas
Reply all
Reply to author
Forward
0 new messages