Print Page | Close Window

[solved] Wrong row selected when clicked

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=22384
Printed Date: 05 May 2024 at 6:02am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [solved] Wrong row selected when clicked
Posted By: DaveH
Subject: [solved] Wrong row selected when clicked
Date Posted: 08 August 2014 at 5:24pm
Hi, I'm having a problem with the Report control (version 16.3.1) where if there are more rows than can be displayed in the control (vertical scrolling is needed), and only part of the bottom row is visible (the control is not an integral multiple of the row height; e.g., it can display 5 full rows and half of the 6th), if I click on that partially-visible row, the Report control will scroll up so that the row is fully visible, but will then select the row that is now where I clicked. I.e., it will select the row after the one I clicked on.

Here's some code that demonstrates the problem... in VB6, put a Report control named ReportControl1 on the form, then paste this as the form code:

Option Explicit

Private Sub Form_Load()
  Dim i As Integer
 
  With ReportControl1
    .ScrollMode = xtpReportScrollModeBlockSize
    '.ScrollMode = xtpReportScrollModeSmooth ' Works OK with this ScrollMode
    For i = 1 To 20
      .AddRecord.AddItem "Row " & i
    Next i
   
    .Columns.Add 0, "Number", 100, True
    .Populate
  End With
End Sub

Private Sub Form_Resize()
  Dim left As Long, top As Long, right As Long, bot As Long
   
  With ReportControl1
    .Redraw
    .Rows.Row(0).GetRect left, top, right, bot
    .Height = (5.6 * (bot - top) + .PaintManager.HeaderHeight) * Screen.TwipsPerPixelY
  End With
End Sub


This should populate the Report control with 20 rows ("Row 1" through "Row 20"), and size it so that 5 rows are fully visible, and Row 6 is partially visible. If you then click on Row 6, it scrolls up one row and selects Row 7. A workaround is to set .ScrollMode = xtpReportScrollModeSmooth, so when it scrolls, the spot where you click is still Row 6. However, it should work regardless of the ScrollMode: the row selected should be the one where the mouse down event occurs, not where the mouse up event occurs.


-------------
SuitePro version 16.3.1

David Huang
Alterity, Inc.

http://www.acctivate.com" rel="nofollow - Inventory and Distribution Management for QuickBooks



Replies:
Posted By: mcmastl
Date Posted: 20 April 2015 at 12:31pm
We have informed our development team of the issue and will be looking into it.  Thank you for bringing this to our attention.  If the issue has been resolved please let us know.  

-------------
Luke McMasters, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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