Page 1 of 1

Filtering in Virtual mode

Posted: Tue Dec 01, 2020 3:01 pm
by 18689076
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

Re: Filtering in Virtual mode

Posted: Mon Dec 07, 2020 2:44 pm
by yeray
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);

Re: Filtering in Virtual mode

Posted: Thu Dec 10, 2020 10:44 am
by 18689076
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

Re: Filtering in Virtual mode

Posted: Fri Dec 11, 2020 6:16 pm
by yeray
Hello,

Another alternative would be to filter the datasource connected to the grid.