FMXGrid filter opreation with hidden column(s)

Hi to all,
it's possible filter a FMXGrid if this grid has some hidden column(s)?

In my form i have a grid with 13 columns (0..12) where the last two (11 and 12) are hidden.

with this code i filter the grid

SG1.RemoveFilters;
with SG1.Filter.Add do
begin
Column:=11;
Condition:='= ' + Filter;
CaseSensitive:=False;
Operation:=foNONE;
end;
SG1.ApplyFilter;

This does not work, but if i use this

SG1.RemoveFilters;
SG1.UnHideColumnsAll;
with SG1.Filter.Add do
begin
Column:=11;
Condition:='= ' + Filter;
CaseSensitive:=False;
Operation:=foNONE;
end;
SG1.ApplyFilter;
SG1.HideColumn(11);
SG1.HideColumn(12);

where i remove the hidden columns before call the filter and after i rehide the columns, it works.
There's a way to filter the grid using the real column number?
I also tried with RealToDisplColumn(11) but it return always 11

Thank's
Daniele

You need to use DisplToRealColumn, because when hiding columns, number 11 is actually 9 (2 hidden columns)

Hi Pieter,
i tried to use RealToDisplColumn but it does not work, better ... i'm not able touse it in rigth way (maybe).

I have 13 columns, 0-12 and the last two (11 -12) are hidden

0 1 2 3 4 5 6 7 8 9 10 11 12 before hide columns
0 1 2 3 4 5 6 7 8 9 10 after hide columns (11, 12)

I need to filter the grid by column 11 value but this column is hidden.
Is possible use a hidden column for filter operation ?

Thank's
Daniele

Hi,

I was mistakenly using a visible for a hidden column. Hidden columns cannot be filtered unfortunately, so you need to unhide them, hide them again afterwards.

Hi Pieter,
it's what i currently do ...
In order to avoid to unhide and hide again the column used for grid filtering, do you think to extend the filter also for hidden columns in a one of next realease?

Thank's
Daniele

We'll investigate the possibilities to add an option to include hidden columns in the filtering results. Not sure if this will make it in the next release, but it will not break existing application code, so you can keep the current implementation.

Thak you Pieter