Class SfDataPager
Represents a control that provides the support to view the records in multiple pages.
Implements
Inherited Members
Namespace: Syncfusion.WinForms.DataPager
Assembly: Syncfusion.SfDataGrid.WinForms.dll
Syntax
public class SfDataPager : BaseControl, IThemeProvider, IVisualStyle, IDisposable, INotifyPropertyChanged
Remarks
You can bind the SfDataPager to any system.collections.IEnumerable collection. The SfDataPager control wraps the collection internally in PagedCollectionView and exposes by using PagedSource property. PagedCollectionView helps to provide the paging functionality. You can apply paging for data bound control by setting PagedSource property as DataSource for that control.
Constructors
SfDataPager()
Initializes a new instance of the SfDataPager class.
Declaration
public SfDataPager()
Properties
AllowGridPaging
Gets or sets a value indicating whether the paging should be enabled for SfDataGrid.
Declaration
public bool AllowGridPaging { get; set; }
Property Value
Type |
---|
System.Boolean |
AllowOnDemandPaging
Gets or sets a value indicating whether to use OnDemandPaging.
Declaration
public bool AllowOnDemandPaging { get; set; }
Property Value
Type |
---|
System.Boolean |
AutoEllipsisMode
Gets or sets a value indicating the auto ellipsis mode.
Declaration
public AutoEllipsisMode AutoEllipsisMode { get; set; }
Property Value
Type |
---|
AutoEllipsisMode |
AutoEllipsisText
Gets or sets a value indicating the auto ellipsis text.
Declaration
public string AutoEllipsisText { get; set; }
Property Value
Type |
---|
System.String |
BackColor
Gets or sets a value indicating the backcolor of the pager.
Declaration
public override Color BackColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
DataSource
Gets or sets a value indicating the data source binded.
Declaration
public IEnumerable DataSource { get; set; }
Property Value
Type |
---|
System.Collections.IEnumerable |
DisplayMode
Gets or sets a value indicating the display mode of the pager.
Declaration
public PageDisplayMode DisplayMode { get; set; }
Property Value
Type |
---|
PageDisplayMode |
HorizontalAlignment
Gets or sets the horizontal alignment for the SfDataPager.
Declaration
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
Type |
---|
System.Windows.Forms.HorizontalAlignment |
NumericButtonCount
Gets or sets a value indicating the buttons count in the numeric button panel.
Declaration
public int NumericButtonCount { get; set; }
Property Value
Type |
---|
System.Int32 |
Orientation
Gets or sets a value indicating the orientation of the pager.
Declaration
public Orientation Orientation { get; set; }
Property Value
Type |
---|
System.Windows.Forms.Orientation |
PageCount
Gets or sets a value indicating the page count.
Declaration
public int PageCount { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
PageCount can be only initialized when AllowOnDemandPaging is enabled.
PagedSource
Gets a value indicating the paged view of the pager.
Declaration
public PagedCollectionView PagedSource { get; }
Property Value
Type |
---|
PagedCollectionView |
PageSize
Gets or sets a value indicating the record size in a page.
Declaration
public int PageSize { get; set; }
Property Value
Type |
---|
System.Int32 |
ScaleChildren
Gets a value indicating whether to autoscale the child controls.
Declaration
protected override bool ScaleChildren { get; }
Property Value
Type |
---|
System.Boolean |
SelectedPageIndex
Gets or sets a value indicating the index of the selected page.
Declaration
public int SelectedPageIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
ShowNavigationTextBox
Gets or sets a value indicating whether the navigation using the text box is enabled or not.
Declaration
public bool ShowNavigationTextBox { get; set; }
Property Value
Type |
---|
System.Boolean |
Style
Gets or sets a value indicating the SfDataPager style.
Declaration
public DataPagerStyle Style { get; set; }
Property Value
Type |
---|
DataPagerStyle |
VerticalAlignment
Gets or sets the vertical alignment for the SfDataPager.
Declaration
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
Type |
---|
System.Windows.Forms.VisualStyles.VerticalAlignment |
Methods
CreateAccessibilityInstance()
Overridden to updated the Accessibility object for the SfDataPager control.
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
Type | Description |
---|---|
System.Windows.Forms.AccessibleObject | Returns the accessibility object of the SfDataPager. |
Dispose(Boolean)
Releases the resources used by the pager and its child controls.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Releases both managed and unmanaged resources if true. Otherwise releases only the unmanaged resources. |
GetControlName(String)
Helps to apply the ControlName settings in control
Declaration
public override string GetControlName(string controlName)
Parameters
Type | Name | Description |
---|---|---|
System.String | controlName | The name of the control |
Returns
Type | Description |
---|---|
System.String | Returns the name of the control |
Overrides
LoadDynamicData(Int32, IEnumerable)
Loads the dynamic data to the pager.
Declaration
public void LoadDynamicData(int startRowIndex, IEnumerable source)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | startRowIndex | The start index of the page. |
System.Collections.IEnumerable | source | The data source to be loaded. |
MoveToFirstPage()
Moves to the first page.
Declaration
public void MoveToFirstPage()
MoveToLastPage()
Moves to the last page.
Declaration
public void MoveToLastPage()
MoveToNextPage()
Moves to the next page.
Declaration
public void MoveToNextPage()
MoveToPage(Int32)
Moves to the page in the specified index.
Declaration
public void MoveToPage(int pageIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageIndex | The page index to be moved. |
MoveToPreviousPage()
Moves to the previous page.
Declaration
public void MoveToPreviousPage()
OnHandleCreated(EventArgs)
Initializes the paged source for OnDemandLoading and moves to selected page when handle created.
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The System.EventArgs that contains event data. |
OnLayout(LayoutEventArgs)
Adds the controls to the pager on layout changes.
Declaration
protected override void OnLayout(LayoutEventArgs eventArgs)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.LayoutEventArgs | eventArgs | The System.Windows.Forms.LayoutEventArgs that contains the event data. |
OnPaint(PaintEventArgs)
Changes the location of the controls when painting.
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | The System.Windows.Forms.PaintEventArgs that contains the event data. |
OnRightToLeftChanged(EventArgs)
Overridden to update the pager buttons when RightToLeft changed.
Declaration
protected override void OnRightToLeftChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The System.EventArgs that contains the event data. |
OnSizeChanged(EventArgs)
Occurs when Size of the pager is changed.
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The System.EventArgs that contains event data. |
OnThemeNameChanged(String)
Helps to set the ThemeName property settings.
Declaration
public override void OnThemeNameChanged(string themeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | themeName | The theme name. |
Overrides
RaiseThemeChanged(Object, ThemeChangedEventArgs)
Raises the ThemeNameChanged and ThemeChanged event when theme name changed.
Declaration
protected override void RaiseThemeChanged(object sender, ThemeChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The sender value. |
ThemeChangedEventArgs | args | A ThemeChangedEventArgs contains the event data. |
Overrides
Events
OnDemandLoading
Occurs when the data for the page is loading on demand.
Declaration
public event EventHandler<OnDemandLoadingEventArgs> OnDemandLoading
Event Type
Type |
---|
System.EventHandler<OnDemandLoadingEventArgs> |
PageIndexChanged
Occurs when the SelectedPageIndex of the SfDataPager is changed.
Declaration
public event EventHandler<PageIndexChangedEventArgs> PageIndexChanged
Event Type
Type |
---|
System.EventHandler<PageIndexChangedEventArgs> |
PageIndexChanging
Occurs before the SelectedPageIndex of the SfDataPager is changing.
Declaration
public event EventHandler<PageIndexChangingEventArgs> PageIndexChanging
Event Type
Type |
---|
System.EventHandler<PageIndexChangingEventArgs> |
PropertyChanged
Occurs when the data pager property is changed.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type |
---|
System.ComponentModel.PropertyChangedEventHandler |
ThemeChanged
Occurs when theme name of the SfDataPager has changed.
Declaration
public event ThemeChangedEventHandler ThemeChanged
Event Type
Type |
---|
ThemeChangedEventHandler |