Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Two "basic" operations on GridCtrl
Re: Two "basic" operations on GridCtrl [message #21115 is a reply to message #21082] |
Mon, 04 May 2009 09:39   |
|
GridCtrl by default uses StdValueCompare function which is "type aware" - so it sorts properly int, double, boolean, time and date types. Unknown types are converted to string and compare as strings (just take a look at Core/Value.cpp file)
If you want to do your own sorting in WhenSort use GetSortOrder method which returns Vector<SortOrder> - the vector with information about columns clicked by user to sort the grid data.
SortOrder consists of:
int id - id of column (each column has unique id which remain the same no matter of real visual column position)
Id name - Id object connected with column
bool ascending, descendig - direction of sorting (only one is set to true of course)
To remove WhenSort action just write:
I implemented WhenSort to being able to react on sort action in scenario when you reload grid data. For example when user clicks column I modify the sql sent to database and the database sorts data and returns it back to the grid. If you would like to sort data already loaded to grid (without clearing grid and populating it again) I'd have to expose internal RowItems collection and I don't want to do this.
So please paste a test case that ilustrate the problem in more datails. We'll try to find a correct solution then.
[Updated on: Mon, 04 May 2009 09:41] Report message to a moderator
|
|
|
 |
|
Two "basic" operations on GridCtrl
By: kbyte on Sun, 26 April 2009 18:27
|
 |
|
Re: Two "basic" operations on GridCtrl
By: unodgs on Sun, 26 April 2009 20:46
|
 |
|
Re: Two "basic" operations on GridCtrl
By: kbyte on Sun, 26 April 2009 21:17
|
 |
|
Re: Two "basic" operations on GridCtrl
By: unodgs on Sun, 26 April 2009 21:43
|
 |
|
Re: Two "basic" operations on GridCtrl
By: kbyte on Mon, 27 April 2009 00:04
|
 |
|
Re: Two "basic" operations on GridCtrl
By: kbyte on Mon, 27 April 2009 00:35
|
 |
|
Re: Two "basic" operations on GridCtrl
By: unodgs on Mon, 27 April 2009 08:47
|
 |
|
Re: Two "basic" operations on GridCtrl
By: kbyte on Sat, 02 May 2009 12:14
|
 |
|
Re: Two "basic" operations on GridCtrl
By: unodgs on Mon, 04 May 2009 09:39
|
 |
|
Re: Two "basic" operations on GridCtrl
By: kbyte on Mon, 04 May 2009 12:52
|
 |
|
Re: Two "basic" operations on GridCtrl
By: unodgs on Mon, 04 May 2009 13:37
|
 |
|
Re: Two "basic" operations on GridCtrl
By: kbyte on Mon, 04 May 2009 14:02
|
 |
|
Re: Two "basic" operations on GridCtrl
By: unodgs on Mon, 04 May 2009 15:22
|
 |
|
Re: Two "basic" operations on GridCtrl
By: kbyte on Mon, 04 May 2009 15:52
|
 |
|
Re: Two "basic" operations on GridCtrl
|
Goto Forum:
Current Time: Fri Jul 18 03:36:25 CEST 2025
Total time taken to generate the page: 0.03794 seconds
|