Print Page | Close Window

Left-click on column header

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=21711
Printed Date: 23 November 2024 at 2:27pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Left-click on column header
Posted By: paulm_wlc
Subject: Left-click on column header
Date 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)?



Replies:
Posted By: paulm_wlc
Date 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.


Posted By: ABuenger
Date Posted: 18 June 2013 at 8:40am
Hi,

please open a support ticket.

Thanks



-------------
Codejock support



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