U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » ArrayCtrl sorting
Re: ArrayCtrl sorting [message #13319 is a reply to message #13313] Tue, 01 January 2008 11:01 Go to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
michael wrote on Mon, 31 December 2007 13:35

Thanks, Mirek.

But i didn't understand how to use Order. Can you please explain this?

Michael


E.g. like this:

struct DatumJmenoOrder : public ArrayCtrl::Order {
	virtual bool operator()(const Vector<Value>& row1, const Vector<Value>& row2) const
	{
		int q;
		q = (Date)row1[0] - (Date)row2[0];
		if(q) return q < 0;
		q = CompareJmeno(row1, row2, 1);
		if(q) return q < 0;
		q = CompareAdresa(row1, row2, 4);
		return q < 0;
	}
};


Compares based on 3 rows, with specific comparisons used for two of them...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Selection changes before LostFocus() is called
Next Topic: How to change GridCtrl background color
Goto Forum:
  


Current Time: Thu Jul 02 01:35:09 GMT+2 2026

Total time taken to generate the page: 0.00781 seconds