Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Click on one column; sort on another
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Click on one column; sort on another

 Post Reply Post Reply
Author
Message
Mike Lewis View Drop Down
Groupie
Groupie


Joined: 29 April 2009
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mike Lewis Quote  Post ReplyReply Direct Link To This Post Topic: Click on one column; sort on another
    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
Back to Top
Mike Lewis View Drop Down
Groupie
Groupie


Joined: 29 April 2009
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mike Lewis Quote  Post ReplyReply Direct Link To This Post 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
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.156 seconds.