Version

MultipleBandSupport Enumeration

Enum for specifying the UltraGridColumnChooser.MultipleBandSupport property.
Syntax
'Declaration
 
Public Enum MultipleBandSupport 
   Inherits System.Enum
public enum MultipleBandSupport : System.Enum 
Members
MemberDescription
DisplayColumnsFromAllBandsColumns from all bands are displayed in the columns list, grouped by the band. Since columns from all bands are displayed, the user interface for selecting a band is not displayed. Note that the UltraGridColumnChooser.CurrentBand property will be ignored by this option and will be reset to null.
ShowBandSelectionUIA user interface for letting the user select a different band is displayed. This is the default option. Initially if the UltraGridColumnChooser.CurrentBand property is set then the columns from that band will be displayed otherwise columns from all bands are displayed. The user then can choose a specific band to display the columns from by selecting that band from the band selector UI. Note: If there is a single band in the UltraGrid then this option will NOT show the band selection UI.
SingleBandOnlyOnly columns from a single band are displayed. No user interface for selecting a different band is available. To specify the band whose columns to display , set the UltraGridColumnChooser.CurrentBand property. If that property is left to null then columns from root band will be displayed.
Example
The following code shows properties, events and methods related to the Column Chooser functionality.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid


    Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles ultraGrid1.InitializeLayout
        ' UltraGrid has a built-in ui for displaying column chooser dialog. To enable
        ' the ui enable the row selectors and set the RowSelectorHeaderStyle to 
        ' ColumnChooserButton.
        e.Layout.Override.RowSelectors = DefaultableBoolean.True
        e.Layout.Override.RowSelectorHeaderStyle = RowSelectorHeaderStyle.ColumnChooserButton

        ' You can exclude a column from the column chooser by setting the ExcludeFromColumnChooser
        ' property to True. This will prevent the user from hiding or unhiding the column.
        e.Layout.Bands(0).Columns("CustomerID").ExcludeFromColumnChooser = ExcludeFromColumnChooser.True

        ' ExcludeFromColumnChooser is also exposed on the band object. So you can exlude a whole
        ' band from the column chooser.
        e.Layout.Bands(1).ExcludeFromColumnChooser = ExcludeFromColumnChooser.True

        ' ColumnChooserCaption property lets you display a different caption in the column
        ' chooser than in the UltraGrid.
        e.Layout.Bands(0).Columns(1).ColumnChooserCaption = "Column Chooser Caption"
    End Sub

    Private Sub UltraGrid1_BeforeColumnChooserDisplayed(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.BeforeColumnChooserDisplayedEventArgs) Handles ultraGrid1.BeforeColumnChooserDisplayed
        ' UltraGrid fires BeforeColumnChooserDisplayed event whenever it's about to
        ' display the column chooser dialog, either via the ColumnChooserButton or
        ' when the ShowColumnChooser method is called on the UltraGrid.

        ' You can access the column chooser dialog that will be displayed using the
        ' Dialog property. Here you can change location, size among other settings
        ' of the dialog.
        e.Dialog.Size = New Size(200, 300)

        ' By default UltraGrid retains the column chooser dialog instance. You can 
        ' set the DisposeOnClose to True to cause the UltraGrid to dispose the dialog 
        ' when it's closed by the user.
        e.Dialog.DisposeOnClose = DefaultableBoolean.True

        ' You can use the ColumnChooserControl property of the dialog to access the
        ' column chooser control that actually displays the list of the columns.
        e.Dialog.ColumnChooserControl.MultipleBandSupport = MultipleBandSupport.SingleBandOnly
        e.Dialog.ColumnChooserControl.Style = ColumnChooserStyle.AllColumnsWithCheckBoxes

        ' By default column chooser attempts to look similar to the source grid whose
        ' columns are being displayed in the column chooser. You can set the
        ' SyncLookWithSourceGrid to false to prevent column chooser from doing this
        ' This will also ensure that the column chooser won't override your appearance
        ' settings.
        e.Dialog.ColumnChooserControl.SyncLookWithSourceGrid = False
        e.Dialog.ColumnChooserControl.DisplayLayout.Appearance.BackColor = SystemColors.Window
    End Sub

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
        ' You can display the column chooser dialog in code using one of the many
        ' overloads of ShowColumnChooser method.
        Me.ultraGrid1.ShowColumnChooser()
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;


		private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
		{
			// UltraGrid has a built-in ui for displaying column chooser dialog. To enable
			// the ui enable the row selectors and set the RowSelectorHeaderStyle to 
			// ColumnChooserButton.
			e.Layout.Override.RowSelectors = DefaultableBoolean.True;
			e.Layout.Override.RowSelectorHeaderStyle = RowSelectorHeaderStyle.ColumnChooserButton;

			// You can exclude a column from the column chooser by setting the ExcludeFromColumnChooser
			// property to True. This will prevent the user from hiding or unhiding the column.
			e.Layout.Bands[0].Columns["CustomerID"].ExcludeFromColumnChooser = ExcludeFromColumnChooser.True;

			// ExcludeFromColumnChooser is also exposed on the band object. So you can exlude a whole
			// band from the column chooser.
			e.Layout.Bands[1].ExcludeFromColumnChooser = ExcludeFromColumnChooser.True;

			// ColumnChooserCaption property lets you display a different caption in the column
			// chooser than in the UltraGrid.
			e.Layout.Bands[0].Columns[1].ColumnChooserCaption = "Column Chooser Caption";
		}

		private void ultraGrid1_BeforeColumnChooserDisplayed(object sender, Infragistics.Win.UltraWinGrid.BeforeColumnChooserDisplayedEventArgs e)
		{
			// UltraGrid fires BeforeColumnChooserDisplayed event whenever it's about to
			// display the column chooser dialog, either via the ColumnChooserButton or
			// when the ShowColumnChooser method is called on the UltraGrid.

			// You can access the column chooser dialog that will be displayed using the
			// Dialog property. Here you can change location, size among other settings
			// of the dialog.
			e.Dialog.Size = new Size( 200, 3500 );

			// By default UltraGrid retains the column chooser dialog instance. You can 
			// set the DisposeOnClose to True to cause the UltraGrid to dispose the dialog 
			// when it's closed by the user.
			e.Dialog.DisposeOnClose = DefaultableBoolean.True;

			// You can use the ColumnChooserControl property of the dialog to access the
			// column chooser control that actually displays the list of the columns.
			e.Dialog.ColumnChooserControl.MultipleBandSupport = MultipleBandSupport.SingleBandOnly;
			e.Dialog.ColumnChooserControl.Style = ColumnChooserStyle.AllColumnsWithCheckBoxes;

			// By default column chooser attempts to look similar to the source grid whose
			// columns are being displayed in the column chooser. You can set the
			// SyncLookWithSourceGrid to false to prevent column chooser from doing this
			// This will also ensure that the column chooser won't override your appearance
			// settings.
			e.Dialog.ColumnChooserControl.SyncLookWithSourceGrid = false;
			e.Dialog.ColumnChooserControl.DisplayLayout.Appearance.BackColor = SystemColors.Window;			
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			// You can display the column chooser dialog in code using one of the many
			// overloads of ShowColumnChooser method.
			this.ultraGrid1.ShowColumnChooser( );
		}
Requirements

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

See Also