Filtering in Virtual mode

TeeGrid VCL / FMX for Embarcadero RAD Studio, Delphi, C++ Builder and Lazarus Free Pascal.
Post Reply
Jonsafi
Newbie
Newbie
Posts: 9
Joined: Tue Jul 14, 2020 12:00 am

Filtering in Virtual mode

Post by Jonsafi » Tue Dec 01, 2020 3:01 pm

Hello,

am using the nice TVirtualModeData
and successfully use

Code: Select all

 procedure GetCell(Sender:TObject; const AColumn:TColumn; const ARow:Integer; var AValue:String);

 
to populate the data. Would like to add a filter to a certain column,
so that the whole row gets hidden.
So obviously, the following doesn't work since the row gets included with blank values..

Code: Select all

if AColumn.Index = column_i Then
Avalue := '';
Is there any way to easily cut off a whole row from the data (prevent it from
being displayed), which has been created normally like so:

Code: Select all

 // Create data, with 10 columns, lots of rows, (optionally: a default column width = 60)
 
Data:=TVirtualModeData.Create(10,20000,60);
Much obliged for your kind help,
Sami

Yeray
Site Admin
Site Admin
Posts: 9509
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Filtering in Virtual mode

Post by Yeray » Mon Dec 07, 2020 2:44 pm

Hello,

You should be better removing the data instead of trying to hide a row.
The easiest way to hide a row I found would be to set a very small height to it. Ie:

Code: Select all

  TeeGrid1.Rows.Heights[4]:=1/Power10(10,10);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Jonsafi
Newbie
Newbie
Posts: 9
Joined: Tue Jul 14, 2020 12:00 am

Re: Filtering in Virtual mode

Post by Jonsafi » Thu Dec 10, 2020 10:44 am

OK, thanks a lot, :D hiding seems like a nice and quick solution.
May be in a future release filtering support will be available.
Take care,
Sami

Yeray
Site Admin
Site Admin
Posts: 9509
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Filtering in Virtual mode

Post by Yeray » Fri Dec 11, 2020 6:16 pm

Hello,

Another alternative would be to filter the datasource connected to the grid.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply