Print Page | Close Window

Column Click - how to trap left click action

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=17404
Printed Date: 15 November 2024 at 3:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Column Click - how to trap left click action
Posted By: mstuart
Subject: Column Click - how to trap left click action
Date Posted: 11 October 2010 at 7:49pm
Hi all,
I'd like to duplicate the functionality of allowing the user to click on a Column, and set the Checkbox type rows to all checked. A lot of applications have this functionality, especially web apps like Yahoo Mail.

If the user clicks on the column heading, it toggles the Check box to all rows checked.
Clicking the Column heading again, unchecks the rows.


Q: how do I capture the left click of a column heading and know which column was clicked so it doesn't interfere with the sorting for other columns?
And then if it's the check box column, call a routine to toggle check the rows.



-------------
Regards,
Mark Stuart

Product: Xtreme SuitePro (ActiveX) v13.2.1
Platform: WinXP (32bit)/Win7 (64bit)
Language: VB6 (SP6), Magic eDeveloper v9.4, uniPaaS v1.9



Replies:
Posted By: Aaron
Date Posted: 12 October 2010 at 4:13pm
Hi,
 
Use MouseDown event:
 
Private Sub wndReportControl_MouseDown(Button As Integer, Shift As Integer, x As Long, y As Long)
    Dim extremeColumn As XtremeReportControl.ReportColumn
    Set extremeColumn = Me.wndReportControl.HitTest(x, y).Column
    If extremeColumn.ItemIndex = 0 Then Call MyOwnCheckBoxFunction
'or
    If Me.wndReportControl.HitTest(x, y).Column.ItemIndex = 0 Then
        Call MyOwnCheckBoxFunction
    End If
End Sub
 
 
Some error handling should be added to above code just in case it fails somewhere Wink
 


-------------
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: mstuart
Date Posted: 12 October 2010 at 5:02pm
Hi Aaron,
Thank you very much for the reply.

After applying the 'or' option of your code, it didn't work for me.

So I used the ReportHitTestInfo object to be returned and then I got the Column.ItemIndex from that object.

Now it works.

Regards,
Mark Stuart


-------------
Regards,
Mark Stuart

Product: Xtreme SuitePro (ActiveX) v13.2.1
Platform: WinXP (32bit)/Win7 (64bit)
Language: VB6 (SP6), Magic eDeveloper v9.4, uniPaaS v1.9



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