Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I hide the row expanders (or How do I share a model between tree and table view)?

0
Posted

How do I hide the row expanders (or How do I share a model between tree and table view)?

0

As there are two types of model – TreeStore and ListStore and only one type of view – TreeView, it is not obvious how to share a model between two views. The trick is to use one model and one view but to control the visibility of row expanders. All we have to do is to add a first dummy column (with no model column equivalent), keep it hidden all the time and switch the ‘expander-column’ property between this and next column (having ‘expander-column’ set to column that is not visible effectively hides the expanders). Please note the user has no way how to expand/collapse the rows when the expanders are hidden – it is useful to expand all rows prior to hiding the expanders.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.