Setting TwwGrid filters in code

Comments

1 comment

  • Roy Woll

    One way would be to model it after our savefilter demo.  Just set TitleAttributes.Enabled to true and change the FormShow event to be like the following.

    procedure TSaveFilterDemo.FormShow(Sender: TObject);
    begin
       wwSaveFilter1:= TwwSaveFilter.create(Application);
       wwSaveFilter1.Delimiter := '///';
       wwSaveFilter1.FilePath := 'SaveFilt.txt';
     
    // Code changes below from original demo
     
    wwdbgrid1.FormGridFilterTypesNeeded;
       wwSaveFilter1.wwFilterDialog := //wwFilterDialog1;
         TwwFilterDialog(wwdbgrid1.FormGridFilterTypes.FilterDialog);
     
     
    Width:= (LongInt(Width) * PixelsPerInch) div 96;
       Height:= (LongInt(Height) * PixelsPerInch) div 96;
    end;

    Now you can load/save filters by name

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk