Print Page | Close Window

Sort Not Working

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=16777
Printed Date: 15 November 2024 at 11:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Sort Not Working
Posted By: faithless
Subject: Sort Not Working
Date Posted: 01 June 2010 at 2:44am
My init code:

                With rc1
                    .Records.DeleteAll
                    .Columns.DeleteAll
                    .Populate
                    .PreviewMode = True
                    .AutoColumnSizing = True
                    .AllowColumnSort = True
                    Set Col = AddColumn(rc1, "", 30, False, False)
                    Set Col = AddColumn(rc1, "", 30, False, False)
                    Set Col = AddColumn(rc1, "COL1", 70, False, False)
                    Col.Alignment = xtpAlignmentCenter
                    Set Col = AddColumn(rc1, "COL2", 100, False, False)
                    Set Col = AddColumn(rc1, "COL3", 125, False, False)
                    Set Col = AddColumn(rc1, "COL4", 250, True, True)
                    Set Col = AddColumn(rc1, "COL5", 300, True, True)
                    Set Col = AddColumn(rc1, "COL6", 50, False, False)
                    Col.Visible = False
                End With
For lCol = 0 To rc1.Columns.Count - 1
      rc1.Columns(lCol).Sortable = True
Next

Private Function AddColumn(ByRef p_ReportControl As ReportControl, ByVal p_Caption As String, ByVal p_MinimumWidthPx As Long, ByVal p_Resizable As Boolean, ByVal p_AutoSize As Boolean, Optional p_Sortable As Boolean = True) As ReportColumn
   ' This is a generic function for adding columns to the ReportControl
   ' It bases the starting column width on the passed miminum column width as suggested by Mark Doubson @ Codejock
   ' See http://forum.codejock.com/forum_posts.asp?TID=13379&PID=48715#48715
   ' It also ensures that the column ItemIndex is correct by basing it on the column count at the time the column is added
  
   With p_ReportControl
      Set AddColumn = .Columns.Add(.Columns.Count, p_Caption, p_MinimumWidthPx - 10, p_Resizable)
      With AddColumn
         .AutoSize = p_AutoSize
         .MinimumWidth = p_MinimumWidthPx
         .Sortable = p_Sortable
      End With
   End With
End Function


After populate of the control clicking colums headers not sort records, it shows only small arrow down or up.



Replies:
Posted By: Aaron
Date Posted: 04 June 2010 at 11:56am
Hi,
 
Can you upload a small test project? So I'm able to reproduce your problem?
 
Thanks
 


-------------
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: Jacob2
Date Posted: 30 June 2010 at 5:28am
I have same problem.

Edit: solved.

At first i used the caption property to assign text to the 'cells'. Now i'm using the value property instead and it's sorting fine.



-------------
Product: Xtreme SuitePro (ActiveX) version 13.2.0
Platform: Windows 7 (64bit)
Language: Visual Basic 6.0 / .NET 2008 / .NET 2010



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