How to track selected/current page is changed

Posted by: sbuc on 7 October 2019, 9:57 am EST

    • Post Options:
    • Link

    Posted 7 October 2019, 9:57 am EST - Updated 4 October 2022, 12:41 am EST

    Hello,

    Is it possible to track when current/selected page is changed (any event)?

  • Posted 10 October 2019, 5:28 am EST

    Hello.

    C1ReportViewer has a PageNumberChanged event that is fired when the current page number changes: https://help.grapecity.com/componentone/NetHelp/c1reportviewerwpf/webframe.html#C1.WPF.ReportViewer.4~C1.WPF.ReportViewer.C1ReportViewer~PageNumberChanged_EV.html

    In case this does not help, kindly elaborate on the kind of viewer and document used.

    Regards,

    Esha

  • Posted 11 October 2019, 8:31 am EST

    Hello Esha,

    Following are used

    Viewer: GrapeCity.ActiveReports.Viewer.Win.Viewer

    Document: GrapeCity.ActiveReports.Document.SectionDocument

    Thank you.

  • Posted 14 October 2019, 5:07 am EST

    Hello,

    You can track the same in the Click event of the Thumbnail, as follows:

     private void viewer1_LoadCompleted(object sender, EventArgs e)
            {
                viewer1.Controls[0].Controls[0].Controls[0].Controls[0].Controls[0].Controls[0].Controls[0].Controls[0].Click += Form1_Click;
            }
            private void Form1_Click(object sender, EventArgs e)
            {
                System.Diagnostics.Debug.WriteLine("Val: " + viewer1.CurrentPage);
            }
    

    Note that the Click event is triggered from the LoadCompleted event of the viewer. Thereafter, the CurrentPage property of the viewer can be used to fetch the current page value. An application showing the same is attached for your reference.

    Hope it helps.

    Regards,

    Esha

    Note: Please post ActiveReports’ cases on the related forum- https://www.grapecity.com/forums/activereports

    prj_ActiveReport_CurrentPage.zip

  • Posted 15 October 2019, 5:18 am EST

    The current page can be changed not only by clicking a mouse button, e.g. using a keyboard.

    I found an alternative solution: event TextChanged of ToolStripTextBox “tstbCurrent”.

    Thank you.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels