Version

ActiveRowScrollRegion Property

Returns or sets the active RowScrollRegion object. This property is not available at design-time.
Syntax
'Declaration
 
Public Property ActiveRowScrollRegion As RowScrollRegion
public RowScrollRegion ActiveRowScrollRegion {get; set;}
Remarks

Use the ActiveRowScrollRegion property to determine which RowScrollRegion object is currently active. If you assign an RowScrollRegion object to the ActiveRowScrollRegion property, it will become the active row scrolling region.

Only one row scrolling region at a time may be the active RowScrollRegion. The active RowScrollRegion is the one that contains the active row (as specified by the ActiveRow property). It is also the row scroll region that receives keyboard navigation focus. For example, if you use the up and down arrow keys to scroll rows, the rows in the row scrolling region specified by ActiveRowScrollRegion are the ones that will move.

Example
Following code shows you how to get the location of a cell, in this case the active cell.

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

   Private Sub Button56_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button56.Click

       ' Get the cell you want to get the location of.
       Dim cell As UltraGridCell = Me.UltraGrid1.ActiveCell

       If Not Nothing Is cell Then
           ' If there are multiple scroll regions, then we have to specify which scroll region to
           ' get the ui element in. A cell could be visible in multiple places if you had split the
           ' grid in two or more scroll regions. Intersection of ActiveRowScrollRegion and the 
           ' ActiveColScrollRegion make up the active scroll region which is where the edit control
           ' would be positioned by the UltraGrid for editing the cell's contents if the cell were
           ' in edit mode.
           Dim rsr As RowScrollRegion = Me.ultraGrid1.ActiveRowScrollRegion
           Dim csr As ColScrollRegion = Me.ultraGrid1.ActiveColScrollRegion

           Dim contexts As Object() = New Object() {rsr, csr, cell}

           ' Get the ui element associated with the cell.
           Dim cellElem As CellUIElement = DirectCast(Me.ultraGrid1.DisplayLayout.UIElement.GetDescendant(GetType(CellUIElement), contexts), CellUIElement)

           If Not Nothing Is cellElem Then
               ' Write out the cell's location in the UltraGrid.
               Dim cellBounds As Rectangle = cellElem.Rect
               Debug.WriteLine("Cell's bounds in the UltraGrid are " & cellBounds.ToString())
           Else
               ' If there is no ui element associated with the cell, then the cell is not visible.
               Debug.WriteLine("Cell is not visible in the UltraGrid.")
           End If
       Else
           Debug.WriteLine("There is no active cell.")
       End If

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

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

	// Get the cell you want to get the location of.
	UltraGridCell cell = this.ultraGrid1.ActiveCell;
	
	if ( null != cell )
	{
		// If there are multiple scroll regions, then we have to specify which scroll region to
		// get the ui element in. A cell could be visible in multiple places if you had split the
		// grid in two or more scroll regions. Intersection of ActiveRowScrollRegion and the 
		// ActiveColScrollRegion make up the active scroll region which is where the edit control
		// would be positioned by the UltraGrid for editing the cell's contents if the cell were
		// in edit mode.
		RowScrollRegion rsr = this.ultraGrid1.ActiveRowScrollRegion;
		ColScrollRegion csr = this.ultraGrid1.ActiveColScrollRegion;

		object[] contexts = new object[] { rsr, csr, cell };

		// Get the ui element associated with the cell.
		CellUIElement cellElem = (CellUIElement)this.ultraGrid1.DisplayLayout.UIElement.GetDescendant( typeof( CellUIElement ), contexts );

		if ( null != cellElem )
		{
			// Write out the cell's location in the UltraGrid.
			Rectangle cellBounds = cellElem.Rect;
			Debug.WriteLine( "Cell's bounds in the UltraGrid are " + cellBounds.ToString( ) );
		}
		else
		{
			// If there is no ui element associated with the cell, then the cell is not visible.
			Debug.WriteLine( "Cell is not visible in the UltraGrid." );
		}
	}
	else
	{
		Debug.WriteLine( "There is no active cell." );
	}

}
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