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 » GridCtrl and sort at runtime
Re: GridCtrl and sort at runtime [message #8299 is a reply to message #8298] Thu, 01 March 2007 15:49 Go to previous messageGo to previous message
unodgs is currently offline  unodgs
Messages: 1367
Registered: November 2005
Location: Poland
Ultimate Contributor

forlano wrote on Thu, 01 March 2007 08:20

I've put some data in a GridCtrl and now I would like to sort it. I do not want give to the user the possibility to sort the GridCtrl because I need to do it one time for all.
With the arrayctrl I had the command arrayctrl.Sort(column). Is there something equivalent (ascending/descending) for gridctrl?
A workaround is to sort the data before to insert them.



Yes, you can - but not so easy. Something to add in the new release. Now you can use GSort method (it's private so make it public first).

void GSort(int col, int order, int from, int count)

to sort the all rows:
grid.GSort(my_column, 0, grid.GetFixedCount(), grid.GetCount());

order can be 0,1 - less, 2 - greater

I will add simpler interface (similar to arrayctrl) in the next rc or final.

After sort call Repaint() to refresh the grid

[Updated on: Thu, 01 March 2007 15:51]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Escaping cursor in gridctrl
Next Topic: just looking for a basic arrayctrl example please
Goto Forum:
  


Current Time: Tue Jul 08 11:38:02 CEST 2025

Total time taken to generate the page: 0.02682 seconds