Version

AfterColRegionScroll Event

Occurs after a column scrolling region is scrolled.
Syntax
'Declaration
 
Public Event AfterColRegionScroll As ColScrollRegionEventHandler
public event ColScrollRegionEventHandler AfterColRegionScroll
Event Data

The event handler receives an argument of type ColScrollRegionEventArgs containing data related to this event. The following ColScrollRegionEventArgs properties provide information specific to this event.

PropertyDescription
ColScrollRegion The col scroll region (read-only)
Remarks

The colscrollregion argument returns a reference to a ColScrollRegion object that can be used to set properties of, and invoke methods on, the colscrollregion that was scrolled. You can use this reference to access any of the returned colscrollregion's properties or methods.

This event is generated after a colscrollregion is scrolled, either programmatically, or by user interaction. A colscrollregion can be scrolled programmatically by invoking its Scroll method.

The ScrollBar property of a scrolling region determines whether a scroll bar is displayed for that scrolling region.

The BeforeColRegionScroll event, which occurs before a column scrolling region is scrolled, is generated before this event.

Example
Following code shows some of the information available in AfterColRegionScroll 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_AfterColRegionScroll(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.ColScrollRegionEventArgs) Handles ultraGrid1.AfterColRegionScroll

       ' AfterColRegionScroll gets fired after a col scroll region has been scrolled.
       ' VisibleHeaders property off the col scroll region can be used to access the
       ' headers that are visible. Following code prints out the visible headers as
       ' the col scroll region is scrolled.

       ' Loop throw all the visible headers and print them out.
       Debug.WriteLine("New visible headers in the col scroll region are: ")
       Dim i As Integer
       For i = 0 To e.ColScrollRegion.VisibleHeaders.Count - 1
           Dim vh As VisibleHeader = e.ColScrollRegion.VisibleHeaders(i)

           ' Get the header associated with the vh VisibleHeader.
           Dim header As HeaderBase = e.ColScrollRegion.VisibleHeaders(i).Header

           If TypeOf header Is Infragistics.Win.UltraWinGrid.ColumnHeader Then
               ' Print out the associated column's key and it's origin (relative to the col scroll region) and the width.
               Debug.WriteLine("    " & header.Band.Key & "." & header.Column.Key & "'s Origin = " & vh.Origin & ", Extent = " & vh.Extent)
           ElseIf TypeOf header Is GroupHeader Then
               ' the header could be a group as well.
               Debug.WriteLine("    " & header.Caption & " group header's Origin = " & vh.Origin & ", Extent = " & vh.Extent)
           ElseIf TypeOf header Is BandHeader Then
               ' the header could be a band header as well.
               Debug.WriteLine("    " & header.Caption & " band header's Origin = " & vh.Origin & ", Extent = " & vh.Extent)
           End If
       Next

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

private void ultraGrid1_AfterColRegionScroll(object sender, Infragistics.Win.UltraWinGrid.ColScrollRegionEventArgs e)
{

	// AfterColRegionScroll gets fired after a col scroll region has been scrolled.
	// VisibleHeaders property off the col scroll region can be used to access the
	// headers that are visible. Following code prints out the visible headers as
	// the col scroll region is scrolled.

	// Loop throw all the visible headers and print them out.
	Debug.WriteLine( "New visible headers in the col scroll region are: " );
	for ( int i = 0; i < e.ColScrollRegion.VisibleHeaders.Count; i++ )
	{
		VisibleHeader vh = e.ColScrollRegion.VisibleHeaders[i];

		// Get the header associated with the vh VisibleHeader.
		HeaderBase header = e.ColScrollRegion.VisibleHeaders[i].Header;
	
		if ( header is Infragistics.Win.UltraWinGrid.ColumnHeader )
		{
			// Print out the associated column's key and it's origin (relative to the col scroll region) and the width.
			Debug.WriteLine( "    " + header.Band.Key + "." + header.Column.Key + "'s Origin = " + vh.Origin + ", Extent = " + vh.Extent );
		}
		else if ( header is GroupHeader )
		{
			// the header could be a group as well.
			Debug.WriteLine( "    " + header.Caption + " group header's Origin = " + vh.Origin + ", Extent = " + vh.Extent );
		}
		else if ( header is BandHeader )
		{
			// the header could be a band header as well.
			Debug.WriteLine( "    " + header.Caption + " band header's Origin = " + vh.Origin + ", Extent = " + vh.Extent );
		}
	}

}
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