Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Imports System.Diagnostics Private Sub Button16_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button16.Click ' IsGroupByColumn indicates if the column is a group-by column. Group-by columns are ' the columns that rows are grouped by. ' Enable Outlook GroupBy functionality by setting the view style to OutlookGroupBy. ' This will show a group-by-box that the user can drag columns into to group row by ' those columns. Me.ultraGrid1.DisplayLayout.ViewStyleBand = ViewStyleBand.OutlookGroupBy Dim band As UltraGridBand = Me.ultraGrid1.DisplayLayout.Bands(0) ' Group rows by Country column. band.SortedColumns.Add("Country", False, True) ' Loop through all the columns and print out the keys of the columns that are ' group-by columns. It should print out Country column since we just made it a ' group-by column above. Dim i As Integer For i = 0 To band.Columns.Count - 1 If band.Columns(i).IsGroupByColumn Then Debug.WriteLine(band.Columns(i).Key & " is a group-by column.") End If Next End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void button16_Click(object sender, System.EventArgs e) { // IsGroupByColumn indicates if the column is a group-by column. Group-by columns are // the columns that rows are grouped by. // Enable Outlook GroupBy functionality by setting the view style to OutlookGroupBy. // This will show a group-by-box that the user can drag columns into to group row by // those columns. this.ultraGrid1.DisplayLayout.ViewStyleBand = ViewStyleBand.OutlookGroupBy; UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0]; // Group rows by Country column. band.SortedColumns.Add( "Country", false, true ); // Loop through all the columns and print out the keys of the columns that are // group-by columns. It should print out Country column since we just made it a // group-by column above. for ( int i = 0; i < band.Columns.Count; i++ ) { if ( band.Columns[i].IsGroupByColumn ) { Debug.WriteLine( band.Columns[i].Key + " is a group-by column." ); } } }
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