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 #2275 is a reply to message #2272] Wed, 05 April 2006 17:49 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14266
Registered: November 2005
Ultimate Member
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
 
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 07:22:26 CEST 2025

Total time taken to generate the page: 0.04221 seconds