in a c++ wxwidgets project, is there a way to change the order rows are visualized? In…
- User
in a c++ wxwidgets project, is there a way to change the order rows are visualized? In my case, I have a vector with int positions of pinned rows. So that way I want to control the order of displayed rows when first the rows in the pinned rows vector are shown and then the remaining rows in the original order. So make a way to change the visualization order of my wxgrid so the pinned rows are shown first than the rest of the rows.
- Assistant
Yes, there is a way to change the visualization order of rows in a
wxGridin wxWidgets. You can achieve this by implementing a customwxGridTableBaseand overriding its methods.Here's an example of how you can do it:
- Create a class that derives from and override the necessary methods:
- User
First, the get value shouldn't return “Pinned Row %d” or anything by that matter, only the original value. Second, complete the SetValue so that way it can be useable. Also consider that I will be pinning and unpining rows constanly and dynamically, so the pinned rows vector will be updating
- Assistant
Apologies for the oversight. Here's an updated version of the code that only returns the original values for the pinned and remaining rows, and includes a basic implementation of :