Gets or sets the index of the page being viewed (between 1 and PageCount).
Namespace:
C1.Web.C1WebReportAssembly: C1.Web.C1WebReport.2 (in C1.Web.C1WebReport.2.dll)
Syntax
C# |
---|
[BrowsableAttribute(false)] [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)] [DefaultValueAttribute()] public int CurrentPage { get; set; } |
Visual Basic (Declaration) |
---|
<BrowsableAttribute(False)> _ <DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)> _ <DefaultValueAttribute()> _ Public Property CurrentPage As Integer Get Set |
Remarks
This property is useful if you want to implement custom navigation bars. For example, you could have four buttons on the page to browse to the first, previous, next and last pages. The buttons would be attached to event handlers that would set the value of the CurrentPage property.
Setting the CurrentPage property to a value smaller than one or greater than PageCount does not throw any exceptions. The control simply adjusts the value and displays the nearest page.
The default value for this property is 1.
Examples
These event handlers could be used to implement a custom navigation bar:
Copy CodeVisual Basic
' handle navigation buttonsPrivateSub _btnFirst_Click(sender AsObject, e As System.Web.UI.ImageClickEventArgs) _c1wr.CurrentPage = 1EndSubPrivateSub _btnPrev_Click(sender AsObject, e As System.Web.UI.ImageClickEventArgs) _c1wr.CurrentPage -= 1EndSubPrivateSub _btnNext_Click(sender AsObject, e As System.Web.UI.ImageClickEventArgs) _c1wr.CurrentPage += 1EndSubPrivateSub _btnLast_Click(sender AsObject, e As System.Web.UI.ImageClickEventArgs) _c1wr.CurrentPage = _c1wr.PageCount EndSub |
Copy CodeC#
// handle navigation buttonsprotectedvoid _btnFirst_Click(object sender, ImageClickEventArgs e) { _c1wr.CurrentPage = 1; } protectedvoid _btnPrev_Click(object sender, ImageClickEventArgs e) { _c1wr.CurrentPage -= 1; } protectedvoid _btnNext_Click(object sender, ImageClickEventArgs e) { _c1wr.CurrentPage += 1; } protectedvoid _btnLast_Click(object sender, ImageClickEventArgs e) { _c1wr.CurrentPage = _c1wr.PageCount; } |