Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [SOLVED] Sort by code
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] Sort by code

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


Joined: 13 April 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote CapoPezzio Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Sort by code
    Posted: 06 September 2010 at 7:13am
Is it possible, by code, to specify column and sortdirecton, and sort the grid (all in code).
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 (32bit)
Language: Visual Basic 6.0
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 13 September 2010 at 10:10am
Hi,
 
you can iterate Columns collection and set the desired column filtrable afterwards
 
            Dim xtremeColumn As XtremeReportControl.ReportColumn
    
            For Each xtremeColumn In Me.wndReportControl.Columns
                xtremeColumn.Filtrable = False
            Next xtremeColumn
           
            Me.wndReportControl.Columns.Find(INDEX_OF_DESIRED_COLUMN).Filtrable = True
            Me.wndReportControl.Columns.Find(INDEX_OF_DESIRED_COLUMN).SortAscending = True or False
 
and set FilterText property to desired text to find
 
            Me.wndReportControl.FilterText = "a"
 
 
 
Hope this helps
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
CapoPezzio View Drop Down
Groupie
Groupie


Joined: 13 April 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote CapoPezzio Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2010 at 9:46am
Thank Aaron. I dont get it to sort. And I dont want do just sort a filter of the data. I want to sort the whole control. All I want is to do excactly what happens when a user click on a column-header to sort the control on that column. I just want to do it by code (example I add all files in a folder to the control. I add the filename and the filedate and then I want to show the list sorted by date on startup)
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 (32bit)
Language: Visual Basic 6.0
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2010 at 10:11am

Hi,

Use SortOrder object...
 
Me.wndReportControl.SortOrder.Add Me.wndReportControl.Columns(0)
 
clicking on first column will add that column to SortOrder collection: Me.wndReportControl.SortOrder(0),
 
you can check this in SortOrderChanged event which column was sorted:
Debug.Print Me.wndReportControl.SortOrder(0).ItemIndex
 
 
Hope this helps Wink
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
CapoPezzio View Drop Down
Groupie
Groupie


Joined: 13 April 2010
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote CapoPezzio Quote  Post ReplyReply Direct Link To This Post Posted: 21 October 2010 at 7:54am
Brillliant. It works. Thank you Aaron!!
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 (32bit)
Language: Visual Basic 6.0
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.219 seconds.