'Declaration Public Property AllowGroupBy As Infragistics.Win.DefaultableBoolean
public Infragistics.Win.DefaultableBoolean AllowGroupBy {get; set;}
The AllowGroupBy property determines whether the user is allowed to group-by the column. If set the False the user won't be allowed to add or remove this column from the group-by box. This property does not prevent you from grouping the rows by the column in code.
To enable the funtionality for grouping rows, set the Layout's UltraGridLayout.ViewStyleBand property to OutlookGroupBy. This will display a group-by box on the top of the grid where the user can drag and drop a column to group rows by that column. To group rows by a column in code, add the column to the UltraGridBand.SortedColumns collection and specify true for the groupBy parameter of the Add method.
Also note that you can set the SortIndicator property of a column to Disabled to disable sorting as well. When SortIndicator is set to Disabled, grouping by the column will be disabled as well.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click ' Disallow the user to group rows by columns. Properties set on DisplayLayout's ' Override effect the whole grid. Me.UltraGrid1.DisplayLayout.Override.AllowGroupBy = DefaultableBoolean.False ' You can override above grid-wide settings on a particular band by setting the ' property in question to a non-default value in the Override object of that ' band. Me.UltraGrid1.DisplayLayout.Bands(0).Override.AllowGroupBy = DefaultableBoolean.True ' Forthermore, you can override settings on the band's and layout's Override ' objects by setting that property on the column itself. Me.UltraGrid1.DisplayLayout.Bands(0).Columns("CustomerID").AllowGroupBy = DefaultableBoolean.False End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void button1_Click(object sender, System.EventArgs e) { // Disallow the user to group rows by columns. Properties set on DisplayLayout's // Override effect the whole grid. this.ultraGrid1.DisplayLayout.Override.AllowGroupBy = DefaultableBoolean.False; // You can override above grid-wide settings on a particular band by setting the // property in question to a non-default value in the Override object of that // band. this.ultraGrid1.DisplayLayout.Bands[0].Override.AllowGroupBy = DefaultableBoolean.True; // Forthermore, you can override settings on the band's and layout's Override // objects by setting that property on the column itself. this.ultraGrid1.DisplayLayout.Bands[0].Columns["CustomerID"].AllowGroupBy = DefaultableBoolean.False; }
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