Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Filter in TGrid ?
Fri, Oct 21 2016 2:22 PMPermanent Link

Luk

Hi,

I want to add a filter to the TGrid.
Would this be a good idea:
- copy original dataset to a filter dataset
- loop the filter dataset and remove rows that don't fit the criteria
- assign this filter dataset to the TGrid.

Or is there an easier way to do this ? Possible to hide rows ?

Thanks,

Luk
Fri, Oct 21 2016 5:37 PMPermanent Link

Bruno Larochelle

hi Luk

if you use a 'Tdataset' and configure it as a query.. you can then filter it that way, and re-load the dataset at runtime. To do that, you want a parameterized query. EWB files quite helpful on this, or ask for more help if need be.

.. Bruno


Luk wrote:

Hi,

I want to add a filter to the TGrid.
Would this be a good idea:
- copy original dataset to a filter dataset
- loop the filter dataset and remove rows that don't fit the criteria
- assign this filter dataset to the TGrid.

Or is there an easier way to do this ? Possible to hide rows ?

Thanks,

Luk

Bruno Larochelle
Logiciels Bitwise Software
Edmonton, AB, Canada
Mon, Oct 24 2016 9:42 AMPermanent Link

Luk

Thanks, that works fine.

But applying a filter without asking the server to do the filtering would be a nice option to have. Smile
Mon, Oct 24 2016 9:57 AMPermanent Link

Bruno Larochelle

right.. I started to realize that upon further thought.. that you did not want to reload

short of having a 'filter' property on the dataset, one could load the dataset information which meets the criteria into a TObjectList.. and then load that into the grid. which sort of goes back to what you were thinking in the first place Smile



Luk wrote:

Thanks, that works fine.

But applying a filter without asking the server to do the filtering would be a nice option to have. Smile

Bruno Larochelle
Logiciels Bitwise Software
Edmonton, AB, Canada
Image