Print Page | Close Window

[SOLVED] Navigator.MoveToRow does not work

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


Topic: [SOLVED] Navigator.MoveToRow does not work
Posted By: Xander75
Subject: [SOLVED] Navigator.MoveToRow does not work
Date 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)



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


Posted By: Xander75
Date 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)



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