Click on one column; sort on another
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=15668
Printed Date: 15 November 2024 at 6:49am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Click on one column; sort on another
Posted By: Mike Lewis
Subject: Click on one column; sort on another
Date Posted: 20 November 2009 at 5:14am
I've done this before, so I know it's possible, but now I can't get it to work.
I want to let the user click on the header of Column 2, but have the grid sorted on Column 5 (which is invisible).
I've tried putting the following in the SortOrderChanged:
IF THIS.SortOrder(0).Index = 2 THIS.SortOrder.DeleteAll THIS.SortOrder.Add(THIS.Columns(5)) THIS.Populate ENDIF
(The above code is Visual FoxPro, but the meaning should be fairly obvious to those of you who prefer VB.)
When I run this, nothing happens when I click on the Column 2 header. The other columns work as expected.
Thanks in advance for any help.
(I'm using ver 13.1 of the ActiveX version of the Report Control.)
Mike
------------- Mike Lewis
Software Developer
Edinburgh, Scotland
|
Replies:
Posted By: Mike Lewis
Date Posted: 24 November 2009 at 12:19pm
I still don't have the solution to this, but it's no longer that important as I've found a workaround.
My aim was to let the user sort on a column of dates. Some of the dates are blank. I wanted the blank dates to sort high, that is, to appear after all other dates (when sorted to ascending order).
My workaround is to set the blank dates to a high value, and to hide them within the grid (by setting the format string to a single space). So now I don't have to bother with the hidden column: the user can just click the date column and it behaves as expected.
I'd still be interested in knowing how to let the user click on one column but sort on another, but it's no longer urgent.
Mike
------------- Mike Lewis
Software Developer
Edinburgh, Scotland
|
|