|
|
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Adding new row to GridCtrl... How to force a resort?
Adding new row to GridCtrl... How to force a resort? [message #23373] |
Wed, 14 October 2009 14:08  |
jeremy_c
Messages: 175 Registered: August 2007 Location: Ohio, USA
|
Experienced Member |
|
|
My grid control is user sortable. The grid control just displays a small summary of the actual records data. There is an Add button on my form. When the user presses the Add button a complex dialog appears to allow them to enter the data needed. They then click save. At that, I add the new row to the GridCtrl but at this point I would like it to not appear at the bottom but in the correct location based on the current sort order.
I looked through the methods, I was hoping for something like .Resort() but did not find it. I do see .Sort() but I am unsure of how to get the current multisort order and direction (i.e. column 1 is UP, column 2 is DOWN and column 5 is UP... who knows what the user will actually do, that was just an example).
Any help is appreciated!
Jeremy
|
|
|
|
Re: Adding new row to GridCtrl... How to force a resort? [message #23383 is a reply to message #23376] |
Thu, 15 October 2009 19:02   |
jeremy_c
Messages: 175 Registered: August 2007 Location: Ohio, USA
|
Experienced Member |
|
|
Ok, this is done and ReSort() now exists. However, it does not seem to be paying attention to the actual sort order as specified by the user at the time ReSort() is called. For example, I have:
[ Date ] [ Name ] [ Number ]
----------------------------
10/12/09 Jim Doe 3.4
10/10/09 John Doe 12.5
05/18/07 Jeff Doe 5.0
The current sort order is Date Descending. When I edit "John Doe" and change the date to "10/18/09" and call ReSort() I get:
[ Date ] [ Name ] [ Number ]
----------------------------
05/18/07 Jeff Doe 5.0
10/12/09 Jim Doe 3.4
10/18/09 John Doe 12.5
Now, to make matters worse when sorting by Number, changing John Doe from 12.5 to 0.1, then calling .ReSort(), it resorts according to Date Ascending order, not Number which is what I had selected at the time.
My setup code for the grid sets initially:
So, it seems to always be reverting to that not what the user may have changed it to.
Any ideas?
Jeremy
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 20:36:17 CEST 2025
Total time taken to generate the page: 0.01030 seconds
|
|
|