Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Automatic sorting
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Automatic sorting

 Post Reply Post Reply
Author
Message
cryo75 View Drop Down
Groupie
Groupie


Joined: 04 June 2006
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote cryo75 Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
cryo75 View Drop Down
Groupie
Groupie


Joined: 04 June 2006
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote cryo75 Quote  Post ReplyReply Direct Link To This Post Posted: 06 December 2006 at 12:25pm
bump!!
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 07 December 2006 at 12:58am
it must work. do you call Populae method?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
cryo75 View Drop Down
Groupie
Groupie


Joined: 04 June 2006
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote cryo75 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 10 December 2006 at 1:59pm
I would recommend you changing the last piece of code to the following:

'Set the properties
Dim sItemValue as String
sItemValue = Item!Name
Set oItm = oRow.AddItem(sItemValue)
oItm.Tag = Item!ID


--
WBR,
Serge
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.234 seconds.