Page 1 of 1

Sorting and Grouping data in Lazarus

Posted: Wed Sep 29, 2021 12:46 pm
by 18691867
Is it possible to sort and group data in TeeGrid in Lazarus? I have data with several thousand rows and a couple of dozen columns and I need to sort and group it by clicking the header.
I tried to use different data providers, for example:
- RTTI. Can't compile. Seems not supported in Lazarus.
- DB. The sorting and grouping functions are not supported by default.
- Strings. It is an array of arrays of strings. Also does not support sorting and grouping by default.

So maybe I'm missing something. Could you show examples of these functions in Lazarus?

Re: Sorting and Grouping data in Lazarus

Posted: Wed Oct 06, 2021 10:34 am
by Marc
Hello,

We're looking at options. TeeGrid Sort depends on the availability of RTTI. We'll get back with any suggestions we may be able to make.

Regards,
Marc Meumann

Re: Sorting and Grouping data in Lazarus

Posted: Mon Nov 08, 2021 9:43 am
by 18691867
Ok, i am using TBufSet and Indexes to sort data. But i can't find the way to simple concatenate columns.

For example i need just a header in two columns. But when i try to do this, the data is always empty.
(demo -> Lazarus -> Database -> ClientDataSet)
screeen1.png
screeen1.png (50.45 KiB) Viewed 36043 times
In the default stringgrid, I can concatenate columns by drawing rectangles above the cells. Is there something like this in teegrid?

Re: Sorting and Grouping data in Lazarus

Posted: Thu Nov 11, 2021 2:55 pm
by yeray
Hello,

I'm not sure to understand the situation. You seem to be adding two sub-columns under "TITLE", but then you want to concatenate them?
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.

Re: Sorting and Grouping data in Lazarus

Posted: Fri Nov 12, 2021 2:10 pm
by 18691867
Yes, that's right, I added two columns. But, I cannot put the data inside.

For example, i want to move the "title" data inside the "qwe" column, and the "author" data inside the "asd" column.
scrn 2021-11-12 170918.png
scrn 2021-11-12 170918.png (10.22 KiB) Viewed 35946 times
This project is from the official demo.

Re: Sorting and Grouping data in Lazarus

Posted: Fri Nov 19, 2021 2:15 pm
by yeray
Hello,

I'm afraid the only way to do this would be using a different structure as explained here.