Version

BeforeRowRegionScrollEventArgs Class

Event parameters used for the BeforeRowRegionScroll event
Syntax
'Declaration
 
Public Class BeforeRowRegionScrollEventArgs 
   Inherits System.ComponentModel.CancelEventArgs
public class BeforeRowRegionScrollEventArgs : System.ComponentModel.CancelEventArgs 
Example
Following code prevents rows from scrolling by canceling BeforeRowRegionScroll event.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

   Private Sub UltraGrid1_BeforeRowRegionScroll(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.BeforeRowRegionScrollEventArgs) Handles ultraGrid1.BeforeRowRegionScroll

       ' There may be circumstances where you may want to conditionally prevent the user
       ' from scrolling. To accomplish that, you can hook into the BeforeRowRegionScroll 
       ' event and cancel it when it gets fired.

       If Me.chkLockScrolling.Checked Then e.Cancel = True

       ' Write old and the new positions of the scroll bar.
       Debug.WriteLine("Old top row index = " & e.OldState.FirstRow.Index)
       Debug.WriteLine("New top row index = " & e.NewState.FirstRow.Index)

   End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void ultraGrid1_BeforeRowRegionScroll(object sender, Infragistics.Win.UltraWinGrid.BeforeRowRegionScrollEventArgs e)
{

	// There may be circumstances where you may want to conditionally prevent the user
	// from scrolling. To accomplish that, you can hook into the BeforeRowRegionScroll 
	// event and cancel it when it gets fired.

	if ( this.chkLockScrolling.Checked )
		e.Cancel = true;

	// Write old and the new positions of the scroll bar.
	Debug.WriteLine( "Old top row index = " + e.OldState.FirstRow.Index );
	Debug.WriteLine( "New top row index = " + e.NewState.FirstRow.Index );

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, 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

See Also