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 » How to sort the ArrCtrl [SOLVED]
Re: How to sort the ArrCtrl [message #2276 is a reply to message #2275] Wed, 05 April 2006 18:03 Go to previous messageGo to previous message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
luzr wrote on Wed, 05 April 2006 16:49

Sorry, that is wrong. GetClickColumn returns the column, but only if you click at "cells".

What you need to use is WhenAction of HeaderCtrl::Column like this:

   array.AddColumn("MyColumn").HeaderTab().WhenAction = THISBACK(SortByColumn);


BTW, quite handy here is using THISBACK1, because that way you can pass column index:

void MyApp::SortColumn(int column)
{
   array.Sort(i);
}

.....
   array.AddColumn("MyColumn1").HeaderTab().WhenAction = THISBACK1(SortByColumn, 0);
   array.AddColumn("MyColumn2").HeaderTab().WhenAction = THISBACK1(SortByColumn, 1);


Mirek


Mirek,
You have been faster than me! Twisted Evil
You have too much free time... Laughing
... Wink
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ArrayCtrl crashes with "embedded" Ctrls referenced by Id [SOLVED]
Next Topic: ArrayCtrl - how to set tooltips? [BY DERIVING...]
Goto Forum:
  


Current Time: Fri Jul 18 05:38:31 CEST 2025

Total time taken to generate the page: 0.05881 seconds