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
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?
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.