Grids generated with K2BTools include a paging component whenever their page size is different from 0 (unlimited).
Starting with version 15.1 this component is created using a user control object. The developer can customize the provided user control object (K2BTools.Controls.PagingBar) or create a new one and reference it in the "Paging bar user control" property in K2BTools General Settings.
The selected UC must conform to the following specifications in order to work correctly as a paging user control.
The user control must contain these properties in its "Properties" part:
<Property Name="CurrentPageNumber" Type="numeric" Default="" />
<Property Name="LastPageNumber" Type="numeric" Default="" />
<Property Name="HasNextPage" Type="boolean" Default="" />
<Property Name="HideIfOnePage" Type="boolean" Default="" />
The properties are set by K2BTools as follows:
- CurrentPageNumber is set to the grid's currently selected page.
- LastPageNumber is set to the last page number if it can be calculated (typically, grids with a base table with Display Page Count = True). If the last page number cannot be efficiently calculated, the value for this property is set to -1. The control should reflect that in this case the last page number is unknown.
- HasNextPage is set only if the last page number cannot be calculated. It is set to true if the user control should let the user navigate to the next page, and to false otherwise.
- HideIfOnePage is set to the same value as the "Hide Paging Bar If One Page" property in K2BTools General Settings. If set to true, the user control should hide all controls related to the paging bar when only one page or less is available. This can happen in two ways:
- LastPageNumber equals zero or one.
- LastPageNumber equals minus one, HasNextPage equals false, and CurrentPageNumber equals zero or one.
The user control should use all these values accordingly when displaying the paging bar.
The paging bar should have these events defined in its Properties part:
<Event Name="FirstPage" On="Click" />
<Event Name="PreviousPage" On="Click" />
<Event Name="NextPage" On="Click" />
<Event Name="LastPage" On="Click" />
<Event Name="GoToPage" On="Click" />
The events should be called by the UC when the user performs the corresponding action.
This event is optional. If it is not defined by the user control, K2BTools does not reference it in generated web panels.
When the event is defined, the UC should set the CurrentPageNumber property before calling the event to the page number that should be navigated to.
Available from K2BTools 15.1
|