New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

DataPager Object

RadDataPager provides the following client-side properties and methods:

Public Properties

PropertyParametersReturn typeDescription
get_uniqueID()noneStringReturns the UniqueID of the RadDataPager.
get_pageCount()noneintegerReturns the page count for the pager control.
get_startRowIndex()noneintegerReturns the index of the first record that is displayed on a page of data.
get_pageSize()noneintegerReturns the page size for the pager control.
set_pageSize()integernoneSets the page size for the pager control.
get_totalRowCount()noneintegerReturns the total number of records that are displayed in the underlying data source.
get_currentPageIndex()noneintegerReturns the current page index for the pager control.
set_currentPageIndex()integernoneSets the current page index for the pager control.

Public Methods

MethodParametersReturn typeDescription
fireCommand(commandName, commandArgument)string, string/integernoneMethod which triggers specific command for the RadDataPager when executed. The method is called for the RadDataPager client instance and its arguments depend on the command which will be processed. The method takes the following arguments
  • string: command name which could be Page or PageSizeChange

  • string/integer: command arguments "First", "Next", "Prev", "Last" or integer value for page size.

Below is a sample illustrating how you can use the fireCommand() client-side method of RadDataPager:

JavaScript
<telerik:RadDataPager RenderMode="Lightweight" ID="RadDataPager1" runat="server">
</telerik:RadDataPager>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">

        function FirePageSizeChangeCommand() {
            var datapager = $find("<%= RadDataPager1.ClientID %>");
            datapager.fireCommand("PageSizeChange", 10);
        }

        function FirePageCommand() {
            var datapager = $find("<%= RadDataPager1.ClientID %>");
            datapager.fireCommand("Page", "Next");
        }

    </script>
</telerik:RadCodeBlock>

See Also