DBAdvGrid filtering

Good afternoon to all,

   is the DBAdvGrid filtering procedure egual to AdvStringGrid procedure?

I have some trouble with filtering in DBAdvGrig.

The dataset is a firebird query component, the grid is set as



    DBG1.ColCount:=4;

    DBG1.Columns[1].FieldName:='EAN';

    DBG1.Columns[1].Header:='Codice';

    DBG1.Columns[1].HeaderFont.Style:=[fsBold];



    DBG1.Columns[2].FieldName:='PRODUCT';

    DBG1.Columns[2].Header:='Prodotto';

    DBG1.Columns[2].HeaderFont.Style:=[fsBold];



    DBG1.Columns[3].FieldName:=PRICE;

    DBG1.Columns[3].Header:='Prezzo';

    DBG1.Columns[3].HeaderFont.Style:=[fsBold];

    DBG1.Columns[3].Alignment:=taRightJustify;



In column 2 ther is a product description and i try to filter it with a TEdit.

Using Narrowdown(Edt1.Text,2) (like B in order to get the all products that starting with B) i have non filter match.

If i use, in edit onchange event,



      DBG1.BeginUpdate;

      // DBG1.RemoveAllFilters;

      DBG1.Filter.Clear;

      with DBG1.Filter.Add do

      begin

        Condition:= '="' + Edt1.Text + '"';

        // even tried with Condition:='= ' + Edt1.Text + '
'

        Column:=2;

      end;

      DBG1.FilterActive:=True;

      // DBG1.ApplyFilter;

      DBG1.EndUpdate;

i got an empty grid as result of filter applied.

sure to make some mistake .... can you suggest me where i wrong?



Thak's for attention.



Daniele



Did you set grid.PageMode = false?

Hi Bruno,

no, i need to set it to true.

The difference from true/false are very well descripted into the document.

My foult to read it after post the message !!! Excuse me !!

There is the possibility to have a third set option that let the user use the grid linked to the dataset but have all the advstringgrid features?



Thank's for your reply and have a good week end.



Daniele

If PageMode=true, you would need to perform the filtering at dataset level. PageMode = true means that only visible rows are loaded from the dataset in the grid, so as the grid does not have all records, it is impossible that it can perform filtering on partial data.