Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 28 Mar 2024, 22:14

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 15 Feb 2021, 14:21 
Offline

Joined: 15 Feb 2021, 14:06
Posts: 4
Hi,
I am new to the forum and have a question:

In a DBGridEh with DataGrouping.Active = True and GroupLevel[0] = ColumnName I want to know how many different "Nodes" are in the table. For further information please look to the file.

Thanks for your help!


Attachments:
File comment: For example here are 14 Countries in the table (Bahamas, Belize, Bermuda, ...)
Unbenannt.PNG
Unbenannt.PNG [ 18.38 KiB | Viewed 1137 times ]
Top
 Profile  
 
PostPosted: 17 Feb 2021, 04:07 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

You can use DBGridEh.DataGrouping.GroupDataTree property to access Grouping Tree.

And use next code to get number of records in the top-level groupings

Code:
procedure TfrDataGrouping.Button1Click(Sender: TObject);
begin
  ShowMessage('The number of records in the top-level groupings - ' +
    DBGridEh1.DataGrouping.GroupDataTree.Root.Count.ToString);
end;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 17 Feb 2021, 08:13 
Offline

Joined: 15 Feb 2021, 14:06
Posts: 4
Thanks for your support. This is not working for me, the result of DBGridEh1.DataGrouping.GroupDataTree.Root.Count is 0.
Maybe, something is wrong in my project?
In DBGridEh DataGrouping active is true, there is one grouplevel DBGridEh1.DataGrouping['ArtNr'] with the columnname Column_5_ArtNr.
Is there something to configure in the MemTable?

Gerd


Top
 Profile  
 
PostPosted: 17 Feb 2021, 08:41 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

Try to test in project MainDemo,
frame - FrameDataGrouping.


Attachments:
sshot-172.png
sshot-172.png [ 41.18 KiB | Viewed 1132 times ]

_________________
Best regards
EhLib Support Team
Top
 Profile  
 
PostPosted: 17 Feb 2021, 13:04 
Offline

Joined: 15 Feb 2021, 14:06
Posts: 4
Hm, I am on 10.0.30 and it's 0
Attachment:
GroupDataTree.Root.Count.PNG
GroupDataTree.Root.Count.PNG [ 63.39 KiB | Viewed 1130 times ]

Same result on 10.0.31 (just updated).

Any idea?


Top
 Profile  
 
PostPosted: 17 Feb 2021, 21:06 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

Make sure you are accessing the correct DBGirdEh with Grouping.
Judging by the screenshot, you have placed the button on the Form1 form where DBGridEh1 is a grid with a list of Demo frames.
Place the button on TfrDataGrouping (unit FrameDataGrouping).

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 18 Feb 2021, 07:50 
Offline

Joined: 15 Feb 2021, 14:06
Posts: 4
:oops: my mistake ...
Now I have to find the difference between my project and datagrouping in the demo. :roll:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group