![]() |
Setting the SortPriority |
Post Reply ![]() |
Author | |
LittleJK ![]() Senior Member ![]() ![]() Joined: 13 April 2006 Status: Offline Points: 168 |
![]() ![]() ![]() ![]() ![]() Posted: 15 November 2006 at 6:53pm |
We are encountering an issue where we are trying set the sortPriority for all our existing records to be all the same say 1 while any new record will have the sortPriority to 0. The desired result would be that the new record(s) will always on top, which when changing the sort by columns the new record(s) will be on top while anything below will be re-sorted based on the column that is sorted.
thanks |
|
![]() |
|
LeeHayton ![]() Senior Member ![]() ![]() Joined: 25 November 2005 Location: United Kingdom Status: Offline Points: 102 |
![]() ![]() ![]() ![]() ![]() |
Why not use 2 groups - one for the new records and on for the existing - and have the new group first.
Then you can sort within the groups any way you like.
|
|
![]() |
|
Fossil ![]() Groupie ![]() ![]() Joined: 29 April 2006 Status: Offline Points: 46 |
![]() ![]() ![]() ![]() ![]() |
In order to have all newly added rows to be gaurenteed on top of the
report control I have created a workaround. First of all I added
a new column called NEWRECORD and turned its visibility to False.
Then turned AutoColumnSorting to false on the control and added the
following code to my form.
Private bDrag as Boolean Private Sub OOS_ReportControl_ColumnOrderChanged() bDrag = True End Sub Private Sub ReportControl_MouseUp(Button As Integer, Shift As Integer, x As Long, y As Long) Dim Column As ReportColumn If Not bDrag Then Select Case Me.ReportControl.HitTest(x, y).ht Case xtpHitTestHeader Set Column = Me.ReportControl.HitTest(x, y).Column If Not Column Is Nothing Then If Column.Sortable Then Column.SortAscending = Not Column.SortAscending Me.ReportControl.SortOrder.DeleteAll Me.ReportControl.SortOrder.Add Me.ReportControl.Columns.Find(COLUMN_NEWRECORD) Me.ReportControl.SortOrder.Add Column Me.ReportControl.Populate End If End If Case xtpHitTestGroupBox Set Column = Me.ReportControl.HitTest(x, y).Column If Not Column Is Nothing Then Column.SortAscending = Not Column.SortAscending Me.ReportControl.Populate End If End Select End If bDrag = False Set Column = Nothing End Sub |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |