Forum
Sign Up
× DataGrid for Qt.C++

How to modify groupRow text?

4 months 1 week ago #1 by Li Rui
I want to obtain the number of records in each group after grouping the table, and modify the text in the GroupRow to: [Group: 'label1', count: 10]. How can I achieve this? Can you provide an example code?

Please Log in or Create an account to join the conversation.

More
4 months 1 week ago #2 by Developer Machines
You can achieve something similar if you will use the summary for groups placed at group row head. To do that plase try:
  Qtitan::GridTableView* view = m_grid->view<Qtitan::GridTableView>();
  view->options().setGroupSummaryPlace(GridViewOptions::SummaryRow);
....
  GridColumn* column = (GridColumn *)view->getColumn(0);
  column->setDefaultGroupSummary(GridSummary::Count);

Please Log in or Create an account to join the conversation.

More
4 months 1 week ago - 4 months 1 week ago #3 by Li Rui
Replied by Li Rui on topic How to modify groupRow text?
Thank you for your reply!

According to the code you provided, I can make the summary information within the grouping line, as shown in the following figure :



However, this method has some obvious shortcomings, namely, the potential for information display overlap, as illustrated in the figure below:



I need information to be displayed completely at all times, just like the picture below. Of course, the picture below is made by me using PhotoShop.



May I ask how I can fulfill my needs? thank you
Attachments:
Last edit: 4 months 1 week ago by Li Rui. Reason: Entered extra images

Please Log in or Create an account to join the conversation.

More
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: Developer Machines
Time to create page: 0.138 seconds

Developer Newsletter

Join our Developer Machines newsletter to get informed on all the latest releases of the commercial components for Qt.C++, Delphi FireMonkey, updates and general knowledges.

Quick Support

Should you need any additional information about our products or licensing, please contact us at the following email addresses:

  • support@devmachines.com

  • license@devmachines.com

Get in Touch

If you would like to purchase our products or services, but don’t know how to do it the right way, please feel free to contact us:

  • support@devmachines.com( any questions related to our products or services )
  • license@devmachines.com( questions related to licensing )