バージョン

EnsureSortedAndFiltered(RecursionType,UltraGridBand) メソッド

RowCollection の Rows がソートまたはフィルターされることを保証します。
シンタックス
'宣言
 
Public Overloads Sub EnsureSortedAndFiltered( _
   ByVal recursion As RecursionType, _
   ByVal lowestLevelBand As UltraGridBand _
) 
public void EnsureSortedAndFiltered( 
   RecursionType recursion,
   UltraGridBand lowestLevelBand
)

パラメータ

recursion
メソッドを現在の RowCollection の Band の子バンドに再帰的に適用すべきかどうかを指定する RecursionType 列挙体。
lowestLevelBand
このメソッドを再帰的に適用する最下位レベルのバンド。

戻り値の型

無効
解説
RecursionType を "None" に指定すると、現在の RowCollection が同時に並べ替えおよびフィルタリングされることを保証します。"All" または "Expanded" を指定すると、指定されたバンドのすべての行またはすべての展開行が同時に並べ替えおよびフィルタリングされます。このメソッドは、最下位レベルのバンドに達するまでこのバンドとすべての子バンドで再帰的に呼び出されます。または lowestLevelBand が null の場合、すべてのバンドが再帰的に呼び出されます。
使用例
' The RowsCollection overloaded EnsureSortedAndFiltered methods afford the developer fine- 
' grained control over synchronous row sorting and filtering.

' This can be usefull in situations where the grid contains a large number of records and
' the developer wishes to display a wait cursor during a sort or filter.  By default the grid
' applies sorting and filtering lazily to rows in each band as it is expanded.  The parameterless
' method simply ensures that the RowsCollection upon which it is called is synchronously sorted
' and filtered.

' Ensure all rows in the current row collection are synchronously sorted and filtered.
Me.ultraGrid1.Rows.EnsureSortedAndFiltered()

' The two additional overloads take as arguments a RecursionType enum value and an UltraGridChildBand
' specifying the lowest level in the hierarchy to apply the synchronous sort and filter.
' Specifying a RecursionType of "None" will ensure the current RowCollection is synchronously sorted
' and filtered.  Specifying "All" or "Expanded" will ensure that either all rows, or all expanded rows, in the 
' specified Bands are synchronously sorted and filtered.  The method will be called called recursively on the
' current Band and all child bands until the lowest level Band is reached or all bands if the lowestLevelBand is null.

' Ensure all rows in the topmost row collection and the rows in all bands below this band in the
' hierarchy are synchronously sorted and filtered.
Me.ultraGrid1.Rows.EnsureSortedAndFiltered(RecursionType.All)

' Ensure all expanded rows in the topmost row collection and the expanded rows in all bands below
' this band in the hierarchy are synchronously sorted and filtered.
Me.ultraGrid1.Rows.EnsureSortedAndFiltered(RecursionType.Expanded)

' Ensure all rows in the specified row collection and the rows in all bands below this band in the
' hierarchy down to the specified lowest level band are synchronously sorted and filtered.
Dim lowestLevelBand As UltraGridChildBand = Me.ultraGrid1.Rows(3).ChildBands(5)
Me.ultraGrid1.Rows(3).ChildBands(2).Rows.EnsureSortedAndFiltered(RecursionType.All, lowestLevelBand)


' The following code demonstrates how to display a wait cursor and specify a synchronous sort and filter
' for a selected set of rows in the grid hierarchy.
Private Sub ultraGrid1_BeforeSortChange(sender As Object, e As Infragistics.Win.UltraWinGrid.BeforeSortChangeEventArgs)

   ' Set the wait cursor
   Me.ultraGrid1.Cursor = Cursors.WaitCursor
   
   ' Ensure all rows in the specified hierarchical range are synchronously sorted and filtered
   Dim lowestLevelBand As UltraGridChildBand = Me.ultraGrid1.Rows(3).ChildBands(5)
   Me.ultraGrid1.Rows(3).ChildBands(2).Rows.EnsureSortedAndFiltered(RecursionType.All, lowestLevelBand)

End Sub 'ultraGrid1_BeforeSortChange


Private Sub ultraGrid2_AfterSortChange(sender As Object, e As Infragistics.Win.UltraWinGrid.BandEventArgs)

   ' Reset the wait cursor
   Me.ultraGrid1.Cursor = Cursors.Default

End Sub 'ultraGrid2_AfterSortChange
// The RowsCollection overloaded EnsureSortedAndFiltered methods afford the developer fine- 
// grained control over synchronous row sorting and filtering.

// This can be usefull in situations where the grid contains a large number of records and
// the developer wishes to display a wait cursor during a sort or filter.  By default the grid
// applies sorting and filtering lazily to rows in each band as it is expanded.  The parameterless
// method simply ensures that the RowsCollection upon which it is called is synchronously sorted
// and filtered.
            
// Ensure all rows in the current row collection are synchronously sorted and filtered.
this.ultraGrid1.Rows.EnsureSortedAndFiltered();
            
// The two additional overloads take as arguments a RecursionType enum value and an UltraGridChildBand
// specifying the lowest level in the hierarchy to apply the synchronous sort and filter.
// Specifying a RecursionType of "None" will ensure the current RowCollection is synchronously sorted
// and filtered.  Specifying "All" or "Expanded" will ensure that either all rows, or all expanded rows, in the 
// specified Bands are synchronously sorted and filtered.  The method will be called called recursively on the
// current Band and all child bands until the lowest level Band is reached or all bands if the lowestLevelBand is null.

// Ensure all rows in the topmost row collection and the rows in all bands below this band in the
// hierarchy are synchronously sorted and filtered.
this.ultraGrid1.Rows.EnsureSortedAndFiltered( RecursionType.All );

// Ensure all expanded rows in the topmost row collection and the expanded rows in all bands below
// this band in the hierarchy are synchronously sorted and filtered.
this.ultraGrid1.Rows.EnsureSortedAndFiltered( RecursionType.Expanded );

// Ensure all rows in the specified row collection and the rows in all bands below this band in the
// hierarchy down to the specified lowest level band are synchronously sorted and filtered.
UltraGridChildBand lowestLevelBand = this.ultraGrid1.Rows[3].ChildBands[5];
this.ultraGrid1.Rows[3].ChildBands[2].Rows.EnsureSortedAndFiltered( RecursionType.All, lowestLevelBand );


// The following code demonstrates how to display a wait cursor and specify a synchronous sort and filter
// for a selected set of rows in the grid hierarchy.

       private void ultraGrid1_BeforeSortChange(object sender, Infragistics.Win.UltraWinGrid.BeforeSortChangeEventArgs e)
       {
	        // Set the wait cursor
	        this.ultraGrid1.Cursor = Cursors.WaitCursor;

	        // Ensure all rows in the specified hierarchical range are synchronously sorted and filtered
	        UltraGridChildBand lowestLevelBand = this.ultraGrid1.Rows[3].ChildBands[5];
           this.ultraGrid1.Rows[3].ChildBands[2].Rows.EnsureSortedAndFiltered( RecursionType.All, lowestLevelBand );
       }

       private void ultraGrid1_AfterSortChange(object sender, Infragistics.Win.UltraWinGrid.BandEventArgs e)
       {
	        // Reset the wait cursor
	        this.ultraGrid1.Cursor = Cursors.Default;       
       }
参照