Page 1 of 1

Record set example

Posted: Sat 22 Jan 2005 22:40
by Wesley Baird
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

Posted: Mon 24 Jan 2005 13:31
by Alex
You can use TCRDBGrid local filtering, for example:

Code: Select all

begin
  CRDBGrid1.Filtered := False;
  CRDBGrid1.OptionsEx :=  CRDBGrid1.OptionsEx + [dgeLocalFilter]; //Default setting
  CRDBGrid1.Columns[1].FilterExpression := '= YES';
  CRDBGrid1.Filtered := True;
end;
If you need more info pls. see "Using Filter Bar of TCRDBGrid Component", "TCRColumn.FilterExpression" and "TCRDBGrid.OptionsEx" topics of ODAC help.

Posted: Tue 25 Jan 2005 11:27
by Wesley Baird
that was what I needed.

thx.