Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Restore original row order
Restore original row order [message #52256] Mon, 19 August 2019 11:33 Go to next message
Maginor is currently offline  Maginor
Messages: 44
Registered: May 2019
Member
Hi,

I have an ArrayCtrl where the rows are displayed as strings, and I have made it so that if you click the column header, it sorts them alphabetically. So far so good.
However, I want to make it so that if you click again, it restores the original order. There is no way to determine the original order by looking at the strings on their own, so I have thought of two solutions.

1. Clear the ArrayCtrl and read the data in again from the original source. Seems a little overkill.

2. Have a second column with the numbers 0..N, and sort by this column to restore the original order. However, I don't want these numbers to be displayed, and I can't find a way to hide a column.

Are there any better ways to do this?
Re: Restore original row order [message #52258 is a reply to message #52256] Mon, 19 August 2019 11:58 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hi,

arrctrl.HeaderObject().HideTab(n);

where n is your column.
Luigi
Re: Restore original row order [message #52259 is a reply to message #52258] Mon, 19 August 2019 12:23 Go to previous message
Maginor is currently offline  Maginor
Messages: 44
Registered: May 2019
Member
Thanks, that worked.
Previous Topic: [Bug]ArrayCtrl,MultiSelect.In WhenSel callback, selection status of last selected row is incorrect
Next Topic: Button in Array segfault
Goto Forum:
  


Current Time: Wed Apr 24 04:25:17 CEST 2024

Total time taken to generate the page: 0.02133 seconds