The version that you requested is unavailable. We've redirected you to the latest version of the help.
Version

Expanded Property (UltraGridRow)

Returns or sets whether the row is expanded. This property is not available at design-time.
Syntax
'Declaration
 
Public Property Expanded As Boolean
public bool Expanded {get; set;}
Remarks

If set to False, the row will be collapsed but child row expand/collapse information will not be discarded. An error occurs if this property is set to True and the Expandable property of the UltraGridBand object is False.

To expand or collapse all the rows of a grid or a specific row collection use the RowsCollection's RowsCollection.ExpandAll and RowsCollection.CollapseAll methods.

Example
Following code toggles a row's Expanded status.

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

   Private Sub Button54_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button54.Click

       Dim row As UltraGridRow = Me.UltraGrid1.Rows(0)

       ' Check to see if the row is expandable which depends on factors like whether
       ' the row has any child rows and whether the band associated with it is expandable.
       ' Return if the row is not expandable
       If Not row.IsExpandable Then
           Return
       End If

       ' Toggle the row's expanded status.
       If Not row.Expanded Then
           ' Set the Expanded to true to expand the row.
           row.Expanded = True
       Else
           ' Set the Expanded to false to collapse the row.
           row.Expanded = False
       End If

       ' IsExpanded property indicates whether the row is actually expanded. For example, If you
       ' were to set Expanded to true on a row that wasn't expandable (ie IsExpandable returned
       ' false), Expanded property would return true even thought the row wasn't actually expanded.
       ' However IsExpanded would rerturn false indicating the true status of the row's expansion
       ' status.
       Debug.WriteLine("Is row actually expanded ? " & row.IsExpanded)

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

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

	UltraGridRow row = this.ultraGrid1.Rows[0];

	// Check to see if the row is expandable which depends on factors like whether
	// the row has any child rows and whether the band associated with it is expandable.
	// Return if the row is not expandable
	if ( !row.IsExpandable )				
		return;

	// Toggle the row's expanded status.
	if ( !row.Expanded )
	{
		// Set the Expanded to true to expand the row.
		row.Expanded = true;
	}
	else
	{
		// Set the Expanded to false to collapse the row.
		row.Expanded = false;
	}

	// IsExpanded property indicates whether the row is actually expanded. For example, If you
	// were to set Expanded to true on a row that wasn't expandable (ie IsExpandable returned
	// false), Expanded property would return true even thought the row wasn't actually expanded.
	// However IsExpanded would rerturn false indicating the true status of the row's expansion
	// status.
	Debug.WriteLine( "Is row actually expanded ? " + row.IsExpanded );

}
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