Version

ScrollGroupIntoView(UltraGridGroup) Method

Scrolls the specified group into view for a colscrollregion.
Syntax
'Declaration
 
Public Overloads Sub ScrollGroupIntoView( _
   ByVal group As UltraGridGroup _
) 
public void ScrollGroupIntoView( 
   UltraGridGroup group
)

Parameters

group
The group to scroll into view
Remarks

Invoke this method to ensure that a group is viewable in a column scrolling region. If the group is already in the viewable area of the column scrolling region, this method does not perform any scrolling.

If invoking this method does cause the column scrolling region to be scrolled, the value of the column scrolling region's Position property changes and the BeforeColRegionScroll event is generated.

The Scroll, ScrollCellIntoView, ScrollColIntoView and ScrollHeaderIntoView methods can also be invoked to scroll an object into a column scrolling region's viewable area.

Example
Following code contains two button click handlers. One shows you how to create groups and the other one illustrates how to scroll a group into view in col-scroll-region.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub Button28_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button28.Click

      ' Following code shows how to create groups in the UltraGrid. It creates two 
      ' groups in the first band.

      ' Get the band to have the groups in.
      Dim band As UltraGridBand = Me.UltraGrid1.DisplayLayout.Bands(0)

      ' Clear existing groups if any.
      band.Groups.Clear()

      ' Add two groups with two different keys. First arguement to the Add call is
      ' the key and the second arguement is the caption of the group.
      band.Groups.Add("G1", "Address Info")
      band.Groups.Add("G2", "Contact Info")

      ' Add some columns to group1
      band.Groups("G1").Columns.Add(band.Columns("CustomerID"), 0)
      band.Groups("G1").Columns.Add(band.Columns("ContactName"), 1)
      band.Groups("G1").Columns.Add(band.Columns("City"), 2)
      band.Groups("G1").Columns.Add(band.Columns("Region"), 3)
      band.Groups("G1").Columns.Add(band.Columns("Country"), 4)

      ' Add Fax and Phone columns to group2..
      band.Groups("G2").Columns.Add(band.Columns("Fax"), 0)
      band.Groups("G2").Columns.Add(band.Columns("Phone"), 0)

  End Sub

  Private Sub Button42_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button42.Click

      ' Following code shows how to scoll a group into view.

      Dim group As UltraGridGroup = Me.UltraGrid1.DisplayLayout.Bands(0).Groups("G2")

      ' Scroll the group into view. Pass in true for leftAlign to scroll the group
      ' to the left as much as possible. There is an overload of ScrollGroupIntoView
      ' that doesn't take this parameter. This overload does not left-align the
      ' group. It scrolls only as much as needed to ensure that the group is fully
      ' visible.
      Me.UltraGrid1.ActiveColScrollRegion.ScrollGroupIntoView(group, True)

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

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

	// Following code shows how to create groups in the UltraGrid. It creates two 
	// groups in the first band.

	// Get the band to have the groups in.
	UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0];
	 		
	// Clear existing groups if any.
	band.Groups.Clear( );
	 	
	// Add two groups with two different keys. First arguement to the Add call is
	// the key and the second arguement is the caption of the group.
	band.Groups.Add( "G1", "Address Info" );
	band.Groups.Add( "G2", "Contact Info" );
 
	// Add some columns to group1
	band.Groups["G1"].Columns.Add( band.Columns["CustomerID"],    0 );
	band.Groups["G1"].Columns.Add(  band.Columns["ContactName"],  1 );
	band.Groups["G1"].Columns.Add( band.Columns["City"],          2 );
	band.Groups["G1"].Columns.Add( band.Columns["Region"],        3 );
	band.Groups["G1"].Columns.Add( band.Columns["Country"],       4 );
	 
	// Add Fax and Phone columns to group2..
	band.Groups["G2"].Columns.Add( band.Columns["Fax"],		   0 );
	band.Groups["G2"].Columns.Add( band.Columns["Phone"],	   0 );

}

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

	// Following code shows how to scoll a group into view.

	UltraGridGroup group = this.ultraGrid1.DisplayLayout.Bands[0].Groups["G2"];

	// Scroll the group into view. Pass in true for leftAlign to scroll the group
	// to the left as much as possible. There is an overload of ScrollGroupIntoView
	// that doesn't take this parameter. This overload does not left-align the
	// group. It scrolls only as much as needed to ensure that the group is fully
	// visible.
	this.ultraGrid1.ActiveColScrollRegion.ScrollGroupIntoView( group, true );			

}
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