Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Left-click on column header
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Left-click on column header

 Post Reply Post Reply
Author
Message
paulm_wlc View Drop Down
Newbie
Newbie


Joined: 17 June 2013
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote paulm_wlc Quote  Post ReplyReply Direct Link To This Post Topic: Left-click on column header
    Posted: 17 June 2013 at 2:24pm
I am using the report control to display a paged list of records (I'm handling the paging). One of the things I'm attempting to handle is when the user clicks on a column header, I actually need to resort on the entire file (not just the page that is currently being displayed to the user). There doesn't appear to be a left-click event for the column headers (which seems to be a weird design decision). 

I did some searching and one way I found to trap this event was in the mouse down event. So I now have code that responds to this event, does a HitTest, then checks to see if the object ht = 1, then checks to see if the column is sortable. If it is, I reload the correct page of data, sorted to match the column the user just clicked.

This seems to work (well, you do see the grid resort, then refresh when I load the correct page of data which isn't ideal, but it's still usable). However, during testing I noticed that ANY click inside of the column area causes this to fire - even just resizing the column headers. 

Any ideas on how to get this event to fire ONLY when the user left-clicks on the column header (and not when they do things like resorting)?
Back to Top
paulm_wlc View Drop Down
Newbie
Newbie


Joined: 17 June 2013
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote paulm_wlc Quote  Post ReplyReply Direct Link To This Post Posted: 18 June 2013 at 7:55am
The work around I came up with (which, so far, appears to work) is I hook into the ColumnWidthChanged event and record the last fired time. Then in the mouse down I check to see if ColumnWidthChanged has fired within the last few seconds - if it has, I ignore the left-click. I'd prefer something cleaner, though.
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 18 June 2013 at 8:40am
Hi,

please open a support ticket.

Thanks

Codejock support
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.155 seconds.