Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [solved] Wrong row selected when clicked
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] Wrong row selected when clicked

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


Joined: 22 December 2008
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote DaveH Quote  Post ReplyReply Direct Link To This Post Topic: [solved] Wrong row selected when clicked
    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.

Inventory and Distribution Management for QuickBooks
Back to Top
mcmastl View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 April 2015
Status: Offline
Points: 79
Post Options Post Options   Thanks (0) Thanks(0)   Quote mcmastl Quote  Post ReplyReply Direct Link To This Post 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
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.172 seconds.