[SOLVED] Sort by code |
Post Reply |
Author | |
CapoPezzio
Groupie Joined: 13 April 2010 Status: Offline Points: 25 |
Post Options
Thanks(0)
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
CapoPezzio
Groupie Joined: 13 April 2010 Status: Offline Points: 25 |
Post Options
Thanks(0)
|
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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
|
|
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.... |
|
CapoPezzio
Groupie Joined: 13 April 2010 Status: Offline Points: 25 |
Post Options
Thanks(0)
|
Brillliant. It works. Thank you Aaron!!
|
|
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 (32bit) Language: Visual Basic 6.0 |
|
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 |