Hi,
I have a record set in a crdbgrid where I want to have a ratio button that allows a user to display records where the field value is equal to YES or NO without requerying the database. So, the crdbgrid would just display all rows where the field = YES or field = NO but the main query gets all of the rows (field=YES & NO). The main query takes a long time to run, so if all of the rows are available, I should not have to requery it just for a selection like this.
Is there an example of this some where?
thx,
wes
Record set example
You can use TCRDBGrid local filtering, for example:
If you need more info pls. see "Using Filter Bar of TCRDBGrid Component", "TCRColumn.FilterExpression" and "TCRDBGrid.OptionsEx" topics of ODAC help.
Code: Select all
begin
CRDBGrid1.Filtered := False;
CRDBGrid1.OptionsEx := CRDBGrid1.OptionsEx + [dgeLocalFilter]; //Default setting
CRDBGrid1.Columns[1].FilterExpression := '= YES';
CRDBGrid1.Filtered := True;
end;