Infragistics(R) NetAdvantage(R) Windows Forms
GetActiveColScrollRegion Method
See Also  Example E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace > UltraGridBase Class : GetActiveColScrollRegion Method

initializeMetrics
UltraGrid lazily re-initializes the column metrics whenever something changes. This parameter specifies whether to verify the column scroll region metrics before returning the active column scroll region.
Returns the active ColScrollRegion object.

Syntax

Visual Basic (Declaration) 
Public Function GetActiveColScrollRegion( _
   ByVal initializeMetrics As Boolean _
) As ColScrollRegion
C# 
public ColScrollRegion GetActiveColScrollRegion( 
   bool initializeMetrics
)

Parameters

initializeMetrics
UltraGrid lazily re-initializes the column metrics whenever something changes. This parameter specifies whether to verify the column scroll region metrics before returning the active column scroll region.

Example

Following code shows that GetActiveColScrollRegion method and ActiveColScrollRegion return the same objects.

Visual BasicCopy Code
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

   Private Sub Button70_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button70.Click

       ' ActiveColScrollRegion and GetActiveColScrollRegion return the same object.			
       Dim colScrollRegion1 As ColScrollRegion = Me.UltraGrid1.ActiveColScrollRegion
       Dim colScrollRegion2 As ColScrollRegion = Me.UltraGrid1.GetActiveColScrollRegion(True)

       ' Write out if both of these objects are the same.
       Debug.WriteLine("ActiveColScrollRegion == GetActiveColScrollRegion: " & (colScrollRegion1 Is colScrollRegion2))

   End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button70_Click(object sender, System.EventArgs e)
{

	// ActiveColScrollRegion and GetActiveColScrollRegion return the same object.			
	ColScrollRegion colScrollRegion1 = this.ultraGrid1.ActiveColScrollRegion;
	ColScrollRegion colScrollRegion2 = this.ultraGrid1.GetActiveColScrollRegion( true );

	// Write out if both of these objects are the same.
	Debug.WriteLine( "ActiveColScrollRegion == GetActiveColScrollRegion: " + ( colScrollRegion1 == colScrollRegion2 ) );

}

Remarks

Use the GetActiveColScrollRegion method to determine which ColScrollRegion object is currently active.

Only one column scrolling region at a time may be the active ColScrollRegion. The active ColScrollRegion is the one that receives keyboard navigation focus. For example, if you use the left and right arrow keys to scroll columns, the columns in the column scrolling region returned by GetActiveColScrollRegion are the ones that will move.

See Also