Forum
Sign Up
× DataGrid for Qt.C++

How to avoid adding a column to the field chooser.

1 year 7 months ago #1 by Stephanie
We are supporting following behavior in application
1)We are using single data model for multiple views.
2)We are hiding some column from one view and show them in other views.
A column which is hidden in a specific view is shown in field chooser is there any way we can avoid them or hide them in the field chooser?
We don't want user can add them to the view for which they are hidden.
Eg.
Consider city column is hidden and we want to city column not to be added to the field chooser.



Please let us know your thoughts.
Attachments:

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

More
1 year 7 months ago #2 by Piotr
Hi Stephanie,

My solution is:
myDataView->options().setAutoCreateColumns(false);
myDataView->setModel(myModel);
// all columns
myDataView->addColumns()
Qtitan::GridTableColumn* column = (Qtitan::GridTableColumn*)myDataView->getColumnByModelColumn(myModel::myColumn); // getColumn
// or selected columns only
Qtitan::GridTableColumn* column = myDataView->addColumn(myModel::myColumn); // addColumn
The following user(s) said Thank You: Stephanie

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

More
1 year 7 months ago #3 by 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.129 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 )