'Declaration Public Event PageIndexChanging As EventHandler(Of CancellablePageChangingEventArgs)
public event EventHandler<CancellablePageChangingEventArgs> PageIndexChanging
The event handler receives an argument of type CancellablePageChangingEventArgs containing data related to this event. The following CancellablePageChangingEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel (Inherited from Infragistics.CancellableEventArgs) | |
ColumnLayout | The ColumnLayout that this event was triggered for. |
Level | The depth at which the ColumnLayout is representing. |
NextPageIndex | The PageIndex of the page of data that will become visible. |
Rows | Gets the collection of rows or row island that this particular ColumnLayout will represent. |
AddHandler Me.MyGrid.PageIndexChanging, AddressOf MyGrid_PageIndexChanging Private Sub MyGrid_PageIndexChanging(ByVal sender As Object, ByVal e As CancellablePageChangingEventArgs) Dim nextPage As Integer = e.NextPageIndex System.Diagnostics.Debug.WriteLine("Next Page Index: " + nextPage.ToString() + ". You can only view odd numbered pages") 'Since the page index is zero based,this will get the odd number page If nextPage Mod 2 = 0 Then 'cancel the event so that only odd numbered pages can be viewed e.Cancel = True End If End Sub 'MyGrid_PageIndexChanging
this.MyGrid.PageIndexChanging += new EventHandler<CancellablePageChangingEventArgs>(dataGrid_PageIndexChanging); private void MyGrid_PageIndexChanging(object sender, CancellablePageChangingEventArgs e) { int nextPage = e.NextPageIndex; //Display to the scroll viewer System.Diagnostics.Debug.WriteLine("Next Page Index: " + nextPage + ". You can only view odd numbered pages") ; // Since the page index is zero based,this will get the odd number page if ((nextPage % 2) == 0) { // Cancel the event so that only odd numbered pages can be viewed e.Cancel = true; } }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2