Skip to content

Commit 335d17a

Browse files
committed
Go to the first record of the dataset at demo start, and added a comment about the limitation of Delphi dataset filtering of partial strings
1 parent 35b68f4 commit 335d17a

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

demos/FireMonkey/TeeGridFeatures/Views/Database/DataSet/Unit_DataSet.fmx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ object FormGridDataSet: TFormGridDataSet
8080
Link = 'Children'
8181
end>
8282
DataSource = DataSource1
83-
ReadOnly = False
8483
Align = Client
8584
Size.Width = 640.000000000000000000
8685
Size.Height = 430.000000000000000000

demos/FireMonkey/TeeGridFeatures/Views/Database/DataSet/Unit_DataSet.pas

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ procedure TFormGridDataSet.CheckBigDataset;
8181
ClientDataSet1.Open;
8282

8383
AddSampleRecords;
84+
85+
ClientDataSet1.First;
8486
finally
8587
ClientDataSet1.EnableControls;
8688
end;
@@ -121,9 +123,9 @@ procedure TFormGridDataSet.Edit1ChangeTracking(Sender: TObject);
121123
function GetWildCard : String;
122124
Begin
123125
if CheckBox2.IsChecked then
124-
result := '*'
126+
result := '*'
125127
else
126-
result:='';
128+
result:='';
127129
end;
128130

129131
var tmpS : String;
@@ -137,6 +139,8 @@ procedure TFormGridDataSet.Edit1ChangeTracking(Sender: TObject);
137139
if tmpS='' then
138140
ClientDataSet1.Filter:=''
139141
else
142+
// Unfortunately, Delphi ClientDataset Filtering do not support *
143+
// wildcards at the beginning of the filter string, only at the end
140144
ClientDataSet1.Filter:='Name = '+QuotedStr(tmpS+GetWildCard);
141145

142146
ClientDataSet1.Filtered:=ClientDataSet1.Filter<>'';

0 commit comments

Comments
 (0)