RadDataPager
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:
[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:
Inherited Members
Constructors
public RadDataPager()
Fields
public const string PageCommandName = "Page"
public const string PageFirstCommandArgument = "First"
public const string PageLastCommandArgument = "Last"
public const string PageNextCommandArgument = "Next"
public const string PagePrevCommandArgument = "Prev"
public const string PageSizeChangeCommandName = "PageSizeChange"
Properties
Gets or sets if the RadDataPager routing is enabled.
public bool AllowRouting { get; set; }
The allow routing.
Get or set whether SEO paging should be used.
public bool AllowSEOPaging { get; set; }
Gets a reference to RadDataPagerClientEvents, which holds properties for setting the RadDataPager client-side events
[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.
[Browsable(false)]
public virtual PageableItemContainerLocator ContainerLocator { get; }
The container locator.
Gets a ControlCollection object that represents the child controls for a specified server control in the UI hierarchy.
public override ControlCollection Controls { get; }
The collection of child controls for the specified server control.
Overrides:
Gets or sets the selected culture. Localization strings will be loaded based on this value.
public CultureInfo Culture { get; set; }
The selected culture. Localization strings will be loaded based on this value.
Gets the index of the current page.
[Browsable(false)]
public int CurrentPageIndex { get; set; }
The index of the current page.
When set to true enables support for WAI-ARIA
public bool EnableAriaSupport { get; set; }
Gets a collection of RadDataPagerField items.
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadDataPagerFieldCollection Fields { get; }
The fields.
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.
public string LocalizationPath { get; set; }
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.
[Browsable(false)]
public int MaximumRows { get; }
The maximum rows.
Read only property. Holds reference to control that implements IRadPageableItemContainer or IPageableItemContainer.
[Browsable(false)]
public IRadPageableItemContainer PageableItemContainer { get; }
Gets the page count of the target paged control.
[Browsable(false)]
public int PageCount { get; }
The page count.
Gets or sets the ID of the control which will be paged.
public virtual string PagedControlID { get; set; }
The paged control ID.
Gets or sets the page size of the target paged control.
public int PageSize { get; set; }
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.
public bool RemoveUrlFromDisabledHyperLinkButtons { get; set; }
Gets or sets the name of the route.
public string RouteName { get; set; }
The name of the route.
Gets or sets the name of the route page index parameter.
public string RoutePageIndexParameterName { get; set; }
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
public string SEOPagingQueryPageKey { get; set; }
Gets the start row index in the specified data source.
[Browsable(false)]
public int StartRowIndex { get; }
The start index.
protected override bool SupportsRenderingMode { get; }
Overrides:
protected override HtmlTextWriterTag TagKey { get; }
Overrides:
Gets the total row count which represents the count in the specified data source.
[Browsable(false)]
public int TotalRowCount { get; }
The total row count.
Methods
protected override void AddAttributesToRender(HtmlTextWriter writer)
Overrides:
Add listener to IRadPageableItemContainer events.
protected virtual void AddListenersToContainer()
Raises Command event
protected virtual void CallCommand(RadDataPagerCommandEventArgs e)
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.
protected virtual bool CallCommandToContainer(string commandName, string commandArgument)
Could be any of the predefined RadDataPager commands or any custom command.
commandArgumentstringCould be any of the predefined RadDataPager commands arguments or any custom argument.
Returns:Return false will command should continue bubble or true if command is handled by RadDataPager.
protected override void CreateChildControls()
Overrides:
This method is called to create all RadDataPager fields.
protected virtual void CreateDataPagerFields()
protected override void DescribeComponent(IScriptDescriptor descriptor)
Overrides:
Triggers command on RadDataPager.
public void FireCommand(RadDataPagerCommandEventArgs commandArgs)
Command argument to be processed by RadDataPager
This method checks query string for the key specified by SEOPagingQueryPageKey and if present attempt to page.
protected void HandleSEOPaging()
protected override void LoadControlState(object savedState)
Overrides:
protected virtual void OnFieldCreated(RadDataPagerFieldCreatedEventArgs e)
protected virtual void OnFieldCreating(RadDataPagerFieldCreatingEventArgs e)
Raises PageIndexChanged event
protected virtual void OnPageIndexChanged(RadDataPagerPageIndexChangeEventArgs e)
This method is called when total row count is supplied by IRadPageableContainer.
protected virtual void OnTotalRowCountAvailable(object sender, RadDataPagerPageEventArgs e)
IRadPageableContainer itself
eRadDataPagerPageEventArgsDataPagerPageEventArgs arguments for creating pager fields
Raises TotalRowCountRequest event
protected virtual void OnTotalRowCountRequest(RadDataPagerTotalRowCountRequestEventArgs e)
protected override void RenderContents(HtmlTextWriter writer)
Overrides:
protected override void TrackViewState()
Overrides:
Events
Raised when a button in a RadDataPager control is clicked.
public event EventHandler<RadDataPagerCommandEventArgs> Command
Raised when pager field item is created.
public event DataPagerFieldCreatedEventHandler<RadDataPagerFieldCreatedEventArgs> FieldCreated
Raised when custom pager field is creating on postback
public event DataPagerFieldCreatingEventHandler<RadDataPagerFieldCreatingEventArgs> FieldCreating
Raised when current page index is changing.
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.
public event EventHandler<RadDataPagerTotalRowCountRequestEventArgs> TotalRowCountRequest