Print Page | Close Window

[SOLVED] Sort by code

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=17210
Printed Date: 15 November 2024 at 4:57pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] Sort by code
Posted By: CapoPezzio
Subject: [SOLVED] Sort by code
Date 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



Replies:
Posted By: Aaron
Date 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....


Posted By: CapoPezzio
Date 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


Posted By: Aaron
Date 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....


Posted By: CapoPezzio
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net