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

Returns or sets a value that determines whether row expansion (plus/minus) indicators are displayed.

Syntax

Visual Basic (Declaration) 
Public Property ExpansionIndicator As ShowExpansionIndicator
C# 
public ShowExpansionIndicator ExpansionIndicator {get; set;}

Example

ExpansionIndicator indicates whether to display expansion indicators for rows and if so how to display them. Always causes the UltraGrid to always display the expansion indicator even if the row doesn't have any child rows (and thus it can't be expanded). CheckOnDisplay will check if a row has child rows before displaying its expansion indicator. CheckOnExpand, which is the default, will display the expansion indicator until an attempt to expand the row is made and at that point if the row is found to not have child rows, then the expansion indicator for the row will not be displayed. Following code sets the ExpansionIndicator property on layout's and band's overrides.

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

  Private Sub Button37_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button37.Click

      ' Set the ExpansionIndicator on the layout's override.
      Me.UltraGrid1.DisplayLayout.Override.ExpansionIndicator = ShowExpansionIndicator.CheckOnDisplay

      ' You can override that grid-wide setting for a particular band by setting it on the
      ' override of that band.
      Me.ultraGrid1.DisplayLayout.Bands(1).Override.ExpansionIndicator = ShowExpansionIndicator.CheckOnExpand

      ' You can also override this setting for a specific row by setting the property on 
      ' that row.
      Me.ultraGrid1.Rows(0).ExpansionIndicator = ShowExpansionIndicator.Never

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

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

	// Set the ExpansionIndicator on the layout's override.
	this.ultraGrid1.DisplayLayout.Override.ExpansionIndicator = ShowExpansionIndicator.CheckOnDisplay;

	// You can override that grid-wide setting for a particular band by setting it on the
	// override of that band.
	this.ultraGrid1.DisplayLayout.Bands[1].Override.ExpansionIndicator = ShowExpansionIndicator.CheckOnExpand;

	// You can also override this setting for a specific row by setting the property on 
	// that row.
	this.ultraGrid1.Rows[0].ExpansionIndicator = ShowExpansionIndicator.Never;

}

Remarks

This property can be used to show expansion indicators for a row that has no children or hide them for a row that does.

The Expanded property can be used to indicate whether the expansion indicator appears expanded (minus) or collapsed (plus).

The BeforeRowExpanded and BeforeRowCollapsed events are generated when the user expands or collapses a row by clicking an expansion indicator.

See Also