ActiveReports.Viewer3 Request technical support
Position Property
See Also  Example


Gets the current page's position in the navigation history.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Position As Integer
Visual Basic (Usage)Copy Code
Dim instance As History
Dim value As Integer
 
value = instance.Position
C# 
public int Position {get;}

Return Value

An integer that specifies the current page's position in the history collection.

Example

C#Copy Code
private void btnBack_Click(object sender, System.EventArgs e)
{
   arv.ReportViewer.History.MovePrev();
   btnBack.Enabled = (arv.ReportViewer.History.Position >= 0);
   btnForward.Enabled = (arv.ReportViewer.History.Position < arv.ReportViewer.History.Count);
}

private void btnForward_Click(object sender, System.EventArgs e)
{
   arv.ReportViewer.History.MoveNext();
   btnBack.Enabled = (arv.ReportViewer.History.Position >= 0);
   btnForward.Enabled = (arv.ReportViewer.History.Position < arv.ReportViewer.History.Count);
}
Visual BasicCopy Code
Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBack.Click
    With arv.ReportViewer.History
        .MovePrev()
        btnBack.Enabled = (.Position >= 0)
        btnForward.Enabled = (.Position < .Count)
    End With
End Sub

Private Sub btnForward_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnForward.Click
    With arv.ReportViewer.History
        .MoveNext()
        btnBack.Enabled = (.Position >= 0)
        btnForward.Enabled = (.Position < .Count)
    End With
End Sub

See Also