New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

RadDataPager can be used to display paging navigation controls for other data-bound controls that implement the IPageableItemContainer or IRadPageableItemContainer interface (like the RadListView and MS ListView). The RadDataPager control lets users view large sets of data in small chunks for faster loading and easier navigation. It also provides a set of events, helper methods and properties for custom intervention.

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
[EmbeddedSkin("DataPager", typeof(RadDataPager))]
[EmbeddedSkin("DataPager", "Default", typeof(RadDataPager))]
[ClientScriptResource("Telerik.Web.UI.RadDataPager", "Telerik.Web.UI.ListView.DataPager.RadDataPagerScripts.js")]
[ToolboxBitmap(typeof(RadDataPager), "Toolbox.Icons.DataPager.png")]
[TelerikToolboxCategory("Data")]
[RequiredScript(typeof(MaterialRipple))]
[RequiredCss("Telerik.Web.UI.Skins.Common.MaterialRipple.css", RenderMode.Lightweight, typeof(RadTreeList))]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadDataPager))]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Mobile, typeof(RadDataPager))]
public class RadDataPager : RadWebControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, INamingContainer, ICompositeControlDesignerAccessor, IPostBackEventHandler

Inheritance: objectControlWebControlRadWebControlRadDataPager

Implements: IAttributeAccessorIComponentICompositeControlDesignerAccessorIControlIControlBuilderAccessorIControlDesignerAccessorIControlResolverIDataBindingsAccessorIDisposableIExpressionsAccessorINamingContainerIParserAccessorIPostBackDataHandlerIPostBackEventHandlerIScriptControlISkinnableControlIUrlResolutionService...

Inherited Members WebControl.ApplyStyle(Style)WebControl.CopyBaseAttributes(WebControl)WebControl.CreateControlStyle()WebControl.MergeStyle(Style)WebControl.RenderBeginTag(HtmlTextWriter)WebControl.RenderEndTag(HtmlTextWriter)WebControl.AccessKeyWebControl.AttributesWebControl.BackColorWebControl.BorderColorWebControl.BorderWidthWebControl.BorderStyleWebControl.ControlStyleWebControl.ControlStyleCreatedWebControl.CssClassWebControl.DisabledCssClassWebControl.StyleWebControl.EnabledWebControl.EnableThemingWebControl.FontWebControl.ForeColorWebControl.HasAttributesWebControl.HeightWebControl.IsEnabledWebControl.SupportsDisabledAttributeWebControl.SkinIDWebControl.TabIndexWebControl.TagNameWebControl.ToolTipWebControl.WidthControl.ResolveAdapter()Control.HasEvents()Control.GetRouteUrl(object)Control.GetRouteUrl(string, object)Control.GetRouteUrl(RouteValueDictionary)Control.GetRouteUrl(string, RouteValueDictionary)Control.GetUniqueIDRelativeTo(Control)Control.ApplyStyleSheetSkin(Page)Control.OnDataBinding(EventArgs)Control.DataBind()Control.DataBind(bool)Control.DataBindChildren()Control.AddParsedSubObject(object)Control.EnsureID()Control.ClearChildState()Control.ClearChildControlState()Control.ClearChildViewState()Control.ClearEffectiveClientIDMode()Control.ClearCachedClientID()Control.Focus()Control.MapPathSecure(string)Control.OpenFile(string)Control.OnPreRender(EventArgs)Control.BuildProfileTree(string, bool)Control.RenderChildren(HtmlTextWriter)Control.RenderControl(HtmlTextWriter)Control.RenderControl(HtmlTextWriter, ControlAdapter)Control.OnUnload(EventArgs)Control.Dispose()Control.RaiseBubbleEvent(object, EventArgs)Control.AddedControl(Control, int)Control.CreateControlCollection()Control.ResolveUrl(string)Control.ResolveClientUrl(string)Control.FindControl(string)Control.FindControl(string, int)Control.GetDesignModeState()Control.HasControls()Control.IsLiteralContent()Control.EnsureChildControls()Control.RemovedControl(Control)Control.SetDesignModeState(IDictionary)Control.SetRenderMethodDelegate(RenderMethod)Control.ClientIDModeControl.ClientIDControl.ClientIDSeparatorControl.ContextControl.AdapterControl.DesignModeControl.EventsControl.IDControl.IsChildControlStateClearedControl.EnableViewStateControl.ViewStateModeControl.IsViewStateEnabledControl.NamingContainerControl.IdSeparatorControl.LoadViewStateByIDControl.PageControl.RenderingCompatibilityControl.TemplateControlControl.ParentControl.TemplateSourceDirectoryControl.AppRelativeTemplateSourceDirectoryControl.SiteControl.VisibleControl.UniqueIDControl.HasChildViewStateControl.ValidateRequestModeControl.ViewStateControl.ViewStateIgnoresCaseControl.ChildControlsCreatedControl.IsTrackingViewStateControl.DisposedControl.DataBindingControl.InitControl.LoadControl.PreRenderControl.Unloadobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
public RadDataPager()

Fields

C#
public const string PageCommandName = "Page"
C#
public const string PageFirstCommandArgument = "First"
C#
public const string PageLastCommandArgument = "Last"
C#
public const string PageNextCommandArgument = "Next"
C#
public const string PagePrevCommandArgument = "Prev"
C#
public const string PageSizeChangeCommandName = "PageSizeChange"

Properties

Gets or sets if the RadDataPager routing is enabled.

C#
public bool AllowRouting { get; set; }
Property Value:

The allow routing.

Get or set whether SEO paging should be used.

C#
public bool AllowSEOPaging { get; set; }

Gets a reference to RadDataPagerClientEvents, which holds properties for setting the RadDataPager client-side events

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadDataPagerClientEvents ClientEvents { get; }

Gets reference to PageableItemContainerLocator which helps in search for controls by ID, Type or finding the controls implementing IRadPageableItemContainer.

C#
[Browsable(false)]
public virtual PageableItemContainerLocator ContainerLocator { get; }
Property Value:

The container locator.

Gets a ControlCollection object that represents the child controls for a specified server control in the UI hierarchy.

C#
public override ControlCollection Controls { get; }
Property Value:

The collection of child controls for the specified server control.

Overrides: Control.Controls

Gets or sets the selected culture. Localization strings will be loaded based on this value.

C#
public CultureInfo Culture { get; set; }
Property Value:

The selected culture. Localization strings will be loaded based on this value.

Gets the index of the current page.

C#
[Browsable(false)]
public int CurrentPageIndex { get; set; }
Property Value:

The index of the current page.

When set to true enables support for WAI-ARIA

C#
public bool EnableAriaSupport { get; set; }

Gets a collection of RadDataPagerField items.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadDataPagerFieldCollection Fields { get; }
Property Value:

The fields.

C#
protected bool IsPageableItemContainerAttached { get; }

Gets or sets a value indicating where RadDataPager will look for its .resx localization file. By default this file should be in the App_GlobalResources folder. However, if you cannot put the resource file in the default location or .resx files compilation is disabled for some reason (e.g. in a DotNetNuke environment), this property should be set to the location of the resource file.

C#
public string LocalizationPath { get; set; }
Property Value:

A relative path to the dialogs location. For example: "~/controls/RadDataPagerResources/".

If specified, the LocalizationPath property will allow you to load the grid localization file from any location in the web application.

Gets the maximum rows.

C#
[Browsable(false)]
public int MaximumRows { get; }
Property Value:

The maximum rows.

Read only property. Holds reference to control that implements IRadPageableItemContainer or IPageableItemContainer.

C#
[Browsable(false)]
public IRadPageableItemContainer PageableItemContainer { get; }

Gets the page count of the target paged control.

C#
[Browsable(false)]
public int PageCount { get; }
Property Value:

The page count.

Gets or sets the ID of the control which will be paged.

C#
public virtual string PagedControlID { get; set; }
Property Value:

The paged control ID.

Gets or sets the page size of the target paged control.

C#
public int PageSize { get; set; }
Property Value:

The page size.

When SEO paging is enabled this property will remove the URL from the HyperLink buttons and will replace it with sharp sign (#). No 'return false' will be used in this case.

C#
public bool RemoveUrlFromDisabledHyperLinkButtons { get; set; }

Gets or sets the name of the route.

C#
public string RouteName { get; set; }
Property Value:

The name of the route.

Gets or sets the name of the route page index parameter.

C#
public string RoutePageIndexParameterName { get; set; }
Property Value:

The name of the route page index parameter.

Get or set query string key for SEO paging. This property may be used in conjunction with AllowSEOPaging

C#
public string SEOPagingQueryPageKey { get; set; }

Gets the start row index in the specified data source.

C#
[Browsable(false)]
public int StartRowIndex { get; }
Property Value:

The start index.

C#
protected override bool SupportsRenderingMode { get; }

Overrides: RadWebControl.SupportsRenderingMode

C#
protected override HtmlTextWriterTag TagKey { get; }

Overrides: WebControl.TagKey

Gets the total row count which represents the count in the specified data source.

C#
[Browsable(false)]
public int TotalRowCount { get; }
Property Value:

The total row count.

Methods

C#
protected override void AddAttributesToRender(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadWebControl.AddAttributesToRender(HtmlTextWriter)

Add listener to IRadPageableItemContainer events.

C#
protected virtual void AddListenersToContainer()
C#
protected void ApplySettingsOnContainer(int startRowIndex, int pageSize, bool shouldBind)
Parameters:startRowIndexintpageSizeintshouldBindbool
C#
protected virtual bool BrowserIsCrawler()
Returns:

bool

Raises Command event

C#
protected virtual void CallCommand(RadDataPagerCommandEventArgs e)
Parameters:eRadDataPagerCommandEventArgs

This method is called whenever any command bubbles from RadDataPagerField. If the command can be handled from RadDataPager it will return true and event bubbling will be prevented. If command name is custom return value will be false and command will continue to bubble.

C#
protected virtual bool CallCommandToContainer(string commandName, string commandArgument)
Parameters:commandNamestring

Could be any of the predefined RadDataPager commands or any custom command.

commandArgumentstring

Could be any of the predefined RadDataPager commands arguments or any custom argument.

Returns:

bool

Return false will command should continue bubble or true if command is handled by RadDataPager.

C#
protected void CallOnPageIndexChanged(int startRowIndex, int pageSize)
Parameters:startRowIndexintpageSizeint
C#
protected override void CreateChildControls()

Overrides: Control.CreateChildControls()

This method is called to create all RadDataPager fields.

C#
protected virtual void CreateDataPagerFields()
C#
protected override void DescribeComponent(IScriptDescriptor descriptor)
Parameters:descriptorIScriptDescriptor

Overrides: RadWebControl.DescribeComponent(IScriptDescriptor)

Triggers command on RadDataPager.

C#
public void FireCommand(RadDataPagerCommandEventArgs commandArgs)
Parameters:commandArgsRadDataPagerCommandEventArgs

Command argument to be processed by RadDataPager

Triggers command on RadDataPager.

C#
public void FireCommand(string commandName, string commandArgument)
Parameters:commandNamestring

Command that will be fired.

commandArgumentstring

Arguments of the command.

C#
protected virtual void HandleClientCommand(string commandName, string commandArgs)
Parameters:commandNamestringcommandArgsstring

This method checks query string for the key specified by SEOPagingQueryPageKey and if present attempt to page.

C#
protected void HandleSEOPaging()
C#
protected virtual void LoadControlInternalState(object savedState)
Parameters:savedStateobject
C#
protected override void LoadControlState(object savedState)
Parameters:savedStateobject

Overrides: Control.LoadControlState(object)

C#
protected override void LoadViewState(object savedState)
Parameters:savedStateobject

Overrides: WebControl.LoadViewState(object)

Handles event that bubbles from any RadDataPagerField. Command event will be triggered.

C#
protected override bool OnBubbleEvent(object source, EventArgs args)
Parameters:sourceobjectargsEventArgsReturns:

bool

Overrides: Control.OnBubbleEvent(object, EventArgs)

C#
protected virtual void OnFieldCreated(RadDataPagerFieldCreatedEventArgs e)
Parameters:eRadDataPagerFieldCreatedEventArgs
C#
protected virtual void OnFieldCreating(RadDataPagerFieldCreatingEventArgs e)
Parameters:eRadDataPagerFieldCreatingEventArgs
C#
protected override void OnInit(EventArgs e)
Parameters:eEventArgs

Overrides: RadWebControl.OnInit(EventArgs)

C#
protected override void OnLoad(EventArgs e)
Parameters:eEventArgs

Overrides: Control.OnLoad(EventArgs)

Raises PageIndexChanged event

C#
protected virtual void OnPageIndexChanged(RadDataPagerPageIndexChangeEventArgs e)
Parameters:eRadDataPagerPageIndexChangeEventArgs

This method is called when total row count is supplied by IRadPageableContainer.

C#
protected virtual void OnTotalRowCountAvailable(object sender, RadDataPagerPageEventArgs e)
Parameters:senderobject

IRadPageableContainer itself

eRadDataPagerPageEventArgs

DataPagerPageEventArgs arguments for creating pager fields

C#
protected virtual void OnTotalRowCountRequest(RadDataPagerTotalRowCountRequestEventArgs e)
Parameters:eRadDataPagerTotalRowCountRequestEventArgs
C#
protected override void Render(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadWebControl.Render(HtmlTextWriter)

C#
protected override void RenderContents(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadWebControl.RenderContents(HtmlTextWriter)

C#
protected virtual object SaveControlInternalState()
Returns:

object

C#
protected override object SaveControlState()
Returns:

object

Overrides: Control.SaveControlState()

C#
protected override object SaveViewState()
Returns:

object

Overrides: WebControl.SaveViewState()

C#
protected override void TrackViewState()

Overrides: WebControl.TrackViewState()

Events

Raised when a button in a RadDataPager control is clicked.

C#
public event EventHandler<RadDataPagerCommandEventArgs> Command

Raised when pager field item is created.

C#
public event DataPagerFieldCreatedEventHandler<RadDataPagerFieldCreatedEventArgs> FieldCreated

Raised when custom pager field is creating on postback

C#
public event DataPagerFieldCreatingEventHandler<RadDataPagerFieldCreatingEventArgs> FieldCreating

Raised when current page index is changing.

C#
public event EventHandler<RadDataPagerPageIndexChangeEventArgs> PageIndexChanged

Raised when RadDataPager is not attached to pageable container and need information regarding total count of the items to page.

C#
public event EventHandler<RadDataPagerTotalRowCountRequestEventArgs> TotalRowCountRequest
In this article
DefinitionConstructorsRadDataPager()FieldsPageCommandNamePageFirstCommandArgumentPageLastCommandArgumentPageNextCommandArgumentPagePrevCommandArgumentPageSizeChangeCommandNamePropertiesAllowRoutingAllowSEOPagingClientEventsContainerLocatorControlsCultureCurrentPageIndexEnableAriaSupportFieldsIsPageableItemContainerAttachedLocalizationPathMaximumRowsPageableItemContainerPageCountPagedControlIDPageSizeRemoveUrlFromDisabledHyperLinkButtonsRouteNameRoutePageIndexParameterNameSEOPagingQueryPageKeyStartRowIndexSupportsRenderingModeTagKeyTotalRowCountMethodsAddAttributesToRender(HtmlTextWriter)AddListenersToContainer()ApplySettingsOnContainer(int, int, bool)BrowserIsCrawler()CallCommand(RadDataPagerCommandEventArgs)CallCommandToContainer(string, string)CallOnPageIndexChanged(int, int)CreateChildControls()CreateDataPagerFields()DescribeComponent(IScriptDescriptor)FireCommand(RadDataPagerCommandEventArgs)FireCommand(string, string)HandleClientCommand(string, string)HandleSEOPaging()LoadControlInternalState(object)LoadControlState(object)LoadViewState(object)OnBubbleEvent(object, EventArgs)OnFieldCreated(RadDataPagerFieldCreatedEventArgs)OnFieldCreating(RadDataPagerFieldCreatingEventArgs)OnInit(EventArgs)OnLoad(EventArgs)OnPageIndexChanged(RadDataPagerPageIndexChangeEventArgs)OnTotalRowCountAvailable(object, RadDataPagerPageEventArgs)OnTotalRowCountRequest(RadDataPagerTotalRowCountRequestEventArgs)Render(HtmlTextWriter)RenderContents(HtmlTextWriter)SaveControlInternalState()SaveControlState()SaveViewState()TrackViewState()EventsCommandFieldCreatedFieldCreatingPageIndexChangedTotalRowCountRequest
Not finding the help you need?
Contact Support