'宣言 Public Function GetRowEnumerator( _ ByVal rowTypes As GridRowType _ ) As IEnumerable
public IEnumerable GetRowEnumerator( GridRowType rowTypes )
Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid ' Row Types indicates which types of rows are enumerated: Data rows, GroupBy rows, or both. ' In this case, return only Data rows. GroupBy rows will be skipped. Dim rowTypes As GridRowType = GridRowType.DataRow ' Get a Row Enumerator that will return all rows in the ' first child band. ' Note that this will not just return a single island of data. ' It will get every row in the child band. This means the child of ' every row in it's direct parent band. Dim band As UltraGridBand = Me.ultraGrid1.DisplayLayout.Bands(1) Dim enumerator As IEnumerable = band.GetRowEnumerator(rowTypes) Dim row As UltraGridRow For Each row In enumerator ' Since this enumerator will only return data rows, we can ' assume each row will have at least one cell. Debug.WriteLine(row.Cells(0).Value) Next
using Infragistics.Win; using Infragistics.Win.UltraWinGrid; // Row Types indicates which types of rows are enumerated: Data rows, GroupBy rows, or both. // In this case, return only Data rows. GroupBy rows will be skipped. GridRowType rowTypes = GridRowType.DataRow; // Get a Row Enumerator that will return all rows in the // first child band. // Note that this will not just return a single island of data. // It will get every row in the child band. This means the child of // every row in it's direct parent band. UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[1]; IEnumerable enumerator = band.GetRowEnumerator(rowTypes); foreach (UltraGridRow row in enumerator) { // Since this enumerator will only return data rows, we can // assume each row will have at least one cell. Debug.WriteLine(row.Cells[0].Value); }