Version

GetOrigin() Method

Returns the absolute coordinate of the leftmost point on the band, taking into consideration the control's entire virtual area.
Syntax
'Declaration
 
Public Overloads Function GetOrigin() As Integer
public int GetOrigin()

Return Value

The absolute coordinate of the leftmost point on the band, taking into consideration the control's entire virtual area.
Remarks

You can use the GetExtent method to return leftmost point on a band, using the scale mode of the grid's container. The coordinate returned by GetOrigin is relative to the absolute left edge of the grid's virtual area. The grid's virtual area is the total space occupied by the grid's data, independent of any display issues. The size of the virtual area is not dependent on the size of the size of the control, it's container, or the system's display settings. How the grid is scrolled and what portion of the band is currently visible on screen will have no effect on the value returned by this method.

Note that to get the actual origin of the band in a specific column scrolling region, you must subtract the ColScrollRegion's Position property from the value returned by GetOrigin

Example
Following code prints out the origin and extent of each band in the UltraGrid. Origin is where the band starts and extent includes the area spanning all the columns of the band. Both GetOrigin and GetExtent methods take BandOrigin enumeration parameter. It indicates what gets taken into account when calculating origin or the extent. For example, when the RowCellArea is specified, returned value doesn't include the row selectors and the space before it. There are overloads that do not take any parameter. These overloads pass PreRowArea to their respective overloads taking the parameter.

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

   Private Sub Button112_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button112.Click

       Dim bands As BandsCollection = Me.UltraGrid1.DisplayLayout.Bands

       ' Loop through all the bands.
       Dim band As UltraGridBand
       For Each band In bands
           ' Get the origin and the extent.
           Dim origin As Integer = band.GetOrigin(BandOrigin.PreRowArea)
           Dim extent As Integer = band.GetExtent(BandOrigin.PreRowArea)

           ' Write out the origin and the extent.
           Debug.WriteLine("bands(" & band.Index & ") Origin = " & origin & ", Extent = " & extent)
       Next

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

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

	BandsCollection bands = this.ultraGrid1.DisplayLayout.Bands;

	// Loop through all the bands.
	foreach ( UltraGridBand band in bands )
	{
		// Get the origin and the extent.
		int origin = band.GetOrigin( BandOrigin.PreRowArea );
		int extent = band.GetExtent( BandOrigin.PreRowArea );				
		
		// Write out the origin and the extent.
		Debug.WriteLine( "bands[" + band.Index + "] Origin = " + origin + ", Extent = " + 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