|  | 
| Automatic sorting | 
| Post Reply   | 
| Author | |
| cryo75   Groupie   Joined: 04 June 2006 Status: Offline Points: 49 |  Post Options  Thanks(0)  Quote  Reply  Topic: Automatic sorting Posted: 05 December 2006 at 2:56am | 
| 
   Hi,
 I've got a reportcontrol with just one column, and it's set to be sorted in ascending order.  When I add records to the control, they are not automatically sorted but simply added to the bottom of the list. How can records be automatically sorted when added? Thanks, Ivan | |
|  | |
| cryo75   Groupie   Joined: 04 June 2006 Status: Offline Points: 49 |  Post Options  Thanks(0)  Quote  Reply  Posted: 06 December 2006 at 12:25pm | 
| 
   bump!!    | |
|  | |
| Oleg   Senior Member   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |  Post Options  Thanks(0)  Quote  Reply  Posted: 07 December 2006 at 12:58am | 
| 
   it must work. do you call Populae method?
    | |
| 
     Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS | |
|  | |
| cryo75   Groupie   Joined: 04 June 2006 Status: Offline Points: 49 |  Post Options  Thanks(0)  Quote  Reply  Posted: 07 December 2006 at 1:12am | 
| 
   Yes I do but it still doesn't work.
 Reportcontrol and column are setup like this:     'Create grid With grdList .AllowColumnRemove = False .AllowColumnReorder = False .AllowColumnResize = False .AllowColumnSort = True .BorderStyle = xtpBorderFrame .MultipleSelection = True .PaintManager.HighlightBackColor = &HC6F3FF .PaintManager.HighlightForeColor = vbBlack .Columns.DeleteAll Set oCol = .Columns.Add(ID_GRID_LOCATION, oLang.Translate(1201), 400, False) oCol.AutoSize = True oCol.Sortable = True oCol.SortAscending = True End With And I add a record like this:     Dim lRow As Long Dim oRow As ReportRecord Dim oItm As ReportRecordItem lRow = GetRowByID(Item!ID) With grdList 'Add to the list If lRow = 0 Then Set oRow = grdList.Records.Add 'Get current record Else Set oRow = grdList.Records(lRow) End If 'Set the properties Set oItm = oRow.AddItem(vbNullString) With oItm .Value = Item!Name .Tag = Item!ID End With         .Populate End With | |
|  | |
| sserge   Moderator Group   Joined: 01 December 2004 Status: Offline Points: 1297 |  Post Options  Thanks(0)  Quote  Reply  Posted: 10 December 2006 at 1:59pm | 
| 
   I would recommend you changing the last piece of code to the following: 
 -- WBR, Serge | |
|  | |
| 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 |