Forum
Sign Up
× DataGrid for Qt.C++

How to allow multiple columns selection of table.

1 year 8 months ago #1 by Stephanie
we are using 5.13.0 version of QtitanDataGrid.
We have checked the API(setSelectionPolicy(GridSelectionPolicy policy)) provided for enabling the multiple row selection, multiple cell selection, but we have not found any enum/API which allowed multiple column selections.
Could you please let us know which API we need to use so that multiple columns selection is possible.

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

More
1 year 8 months ago #2 by Developer Machines
Grid does not have a special mode for selecting cells in a column. Implied that the selection of columns is a special case of the multiple cells selection.
I would suggest to catch the click on the table header via the columnClicked (ColumnClickEventArgs * args); and select the cells under the column:
    int columnIndex = 1;
    Qtitan::GridTableView* view = m_grid->view<Qtitan::GridTableView>();
    view->selectRange(0, view->getRowCount() - 1, columnIndex, columnIndex, Qtitan::Clear | Qtitan::Select);
    m_grid->update();
The following user(s) said Thank You: Stephanie

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 MachinesEduard
Time to create page: 0.123 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:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

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:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.( any questions related to our products or services )
  • This email address is being protected from spambots. You need JavaScript enabled to view it.( questions related to licensing )