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

Gets or sets the max band depth. Grid will load upto MaxBandDepth number of bands. Note that you have to set the MaxBandDepth before binding the UltraGrid.

Syntax

Visual Basic (Declaration) 
Public Property MaxBandDepth As Integer
C# 
public int MaxBandDepth {get; set;}

Example

Following code sets the MaxBandDepth to 2 thus allowing only upto two bands in the UltraGrid.

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

  Private Sub Button20_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button20.Click

      ' Load only upto two descendant bands. So even if the data source has more than 2 level 
      ' deep hierarchy, the UltraGrid will only make use of first two levels and ignore the 
      ' levels deeper than that.
      Me.ultraGrid1.DisplayLayout.MaxBandDepth = 2
      Me.ultraGrid1.SetDataBinding(Me.ultraGrid1.DataSource, "")

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

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

	// Load only upto two descendant bands. So even if the data source has more than 2 level 
	// deep hierarchy, the UltraGrid will only make use of first two levels and ignore the 
	// levels deeper than that.
	this.ultraGrid1.DisplayLayout.MaxBandDepth = 2;

	this.ultraGrid1.SetDataBinding( this.ultraGrid1.DataSource, "" );

}

Remarks

Use this property to force the grid to load upto only a certain number of bands. This can come in use where you have a recursive data relation where a table is related to itself and you only want the grid to drill down the band hierarchy only upto a certain level.

Default value for this property is 100 and range is 1-100 inclusive. Throws an ArgumentOutOfRange exception if set to a value below 1 or greater than 100.

Note: You must set the MaxBandDepth before binding the UltraGrid to a data source in order for this property to have any effect.

See Also