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 #8301 is a reply to message #8299] Thu, 01 March 2007 16:45 Go to previous messageGo to previous message
forlano is currently offline  forlano
Messages: 1215
Registered: March 2006
Location: Italy
Senior Contributor
unodgs wrote on Thu, 01 March 2007 15:49


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




Unfortunately does not work. In the constructor I filled the grid and used Gsort
...
for (i=1; i<=TD.NPlayer; i++) arr.Add( player[i].RATING, player[i].name);
arr.GSort( 0, 2, arr.GetFixedCount(), arr.GetCount());
arr.Repaint();
...

But the order remain the same. I've used all type of order (0,1,2). BTW what is it GetFixedCount()?
Thanks,
Luigi
 
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: Sat Aug 30 00:15:42 CEST 2025

Total time taken to generate the page: 0.04540 seconds