Looking some more into the DVC stuff I noticed the above method and wondered if this would be helpful in doing "grouping" similar to what ObjectListView allows (define a column as "grouped" and when clicking its header the list will be sorted by that column and items with the same content in that column will be grouped.
I tried to override it in a PyDataViewModel based class but the method doesn't get called.
Looking some more into the DVC stuff I noticed the above method and
wondered if this would be helpful in doing "grouping" similar to what
ObjectListView allows (define a column as "grouped" and when clicking
its header the list will be sorted by that column and items with the
same content in that column will be grouped.
No, I think it is just for determining if items that have children also have values in the columns other than the one with the tree.
I tried to override it in a PyDataViewModel based class but the method
doesn't get called.
It is definitely called in the C++ code, and at least in my current build that call is making it to the Python implementation of the method as well. One thing I noticed is that it is only called after checking IsContainer, so if you just have a flat list with no hierarchy then it won't be called.
if (model->IsContainer(dataitem) &&
!model->HasContainerColumns(dataitem))
{
...
}
Looking some more into the DVC stuff I noticed the above method and
wondered if this would be helpful in doing "grouping" similar to what
ObjectListView allows (define a column as "grouped" and when clicking
its header the list will be sorted by that column and items with the
same content in that column will be grouped.
No, I think it is just for determining if items that have children also have values in the columns other than the one with the tree.
That makes sense.
Are you aware if there is such as thing as "grouping" items. Kind of like a single level tree where one looks not at the whole item to determine the parent or child but instead at the value of the grouped by column, if the value changes create a group and all others are children until the value changes again.
Or is this something one has to do oneself, I guess yes. If yes, at what point (event/method) should one use to reorganize/reorder the data?
wondered if this would be helpful in doing "grouping" similar
to what
ObjectListView allows (define a column as "grouped" and when
clicking
its header the list will be sorted by that column and items
with the
same content in that column will be grouped.
No, I think it is just for determining if items that have
children also have values in the columns other than the one with
the tree.
That makes sense.
Are you aware if there is such as thing as "grouping" items. Kind
of like a single level tree where one looks not at the whole item
to determine the parent or child but instead at the value of the
grouped by column, if the value changes create a group and all
others are children until the value changes again.
Or is this something one has to do oneself, I guess yes. If yes,
at what point (event/method) should one use to reorganize/reorder
the data?
I shouldn’t ask questions before I had my morning tea.
I assume it is this event.
EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, func):
Process a wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICKED
event.