Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [SOLVED] Navigator.MoveToRow does not work
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] Navigator.MoveToRow does not work

 Post Reply Post Reply
Author
Message
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Navigator.MoveToRow does not work
    Posted: 13 August 2010 at 7:39am
Subject Continued: "with the ReportControl using Grouping Column and Tree Column..."

Hi,

I have a requirement to scroll a ReportControl that has both a Grouping Column and a Tree Column to a specific row.

Using either "EnsureVisible" or "Navigator.MoveToRow" does work kind of! However the Grouping row seems to knock this out slightly and the moment I expand a few tree columns then try and use either of these to scroll to the row in question it does not scroll to the correct row!

To help you understand I have attached an image of my application below. In the image below you can clearly see the Grouping column and Tree columns are used and that the Highlighted Row is the row I have tried to scroll to. However this has scrolled to the wrong row due to the Grouping row heights I believe. If I then scroll up further and expand a few tree columns and then move to the row the result is worse!!!

I am using the Statusbar "Forecast Products" pane as a button to focus the users attention to the Forecasted Products in the ReportControl, however this functionality can't work using the "EnsureVisible" or "Navigator.MoveToRow" in combination with the Grouping Column and a Tree Column.



Is there any method other than these two to scroll programmatically to a row?

Thanks.
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2010 at 10:45am
Hi,
 
Try this instead:
 
Dim rowToFind As ReportRow
   
    Set rowToFind = Me.wndReportControl.Rows.FindRowInTree(Me.wndReportControl.Records(INDEX_OF_RECORD))
          rowToFind.EnsureVisible
    
OR
   
    Set rowToFind = Me.wndReportControl.Rows.FindRowInTree(Me.wndReportControl.Records(INDEX_OF_RECORD))
    Me.wndReportControl.Navigator.MoveToRow rowToFind.Index
 
 
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....
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 16 August 2010 at 3:16am
Nice one Aaron!!!

Using your suggestion I first set the grid to scroll to the last record in the grid before scrolling to the row in question. This allows the record to be at the top of the ReportControl, tested this with expanding the tree and all works perfectly.


        With rpcGrid
            ' Find the Last Row
            Set LastRow = .Rows.FindRowInTree(LastRecord)
            .Navigator.MoveToRow LastRow.Index, False, True
           
            ' Find the First Forecasted Product Row
            Set Row = .Rows.FindRowInTree(Record)
            .Navigator.MoveToRow Row.Index, False, True
           
            .Populate
            .SelectedRows.DeleteAll
            .ReDraw
        End With


I must admit... I tried this late on Friday before I got your reply, but it was late in the day and all I could think about was the weekend!!! lol

Thanks for the help.

Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
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.203 seconds.