Version

VisibleHeadersCollection Class

Collection of all VisibleHeaders within a specific Header scrolling region.
Syntax
'Declaration
 
Public Class VisibleHeadersCollection 
   Inherits Infragistics.Shared.SubObjectsCollectionBase
public class VisibleHeadersCollection : Infragistics.Shared.SubObjectsCollectionBase 
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