menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ColumnChooser - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ColumnChooser

    Represents a ColumnChooser control that is used to add or remove columns to the SfDataGrid dynamically.

    Inheritance
    System.Object
    ColumnChooser
    Implements
    IThemeProvider
    IVisualStyle
    Namespace: Syncfusion.WinForms.DataGrid.Interactivity
    Assembly: Syncfusion.SfDataGrid.WinForms.dll
    Syntax
    public class ColumnChooser : UserControl, IThemeProvider, IVisualStyle

    Constructors

    ColumnChooser(SfDataGrid)

    Initializes a new instance of the ColumnChooser class.

    Declaration
    public ColumnChooser(SfDataGrid sfDataGrid)
    Parameters
    Type Name Description
    SfDataGrid sfDataGrid

    Instance of the SfDataGrid for which the column chooser is created.

    Properties

    BaseThemeName

    Gets or sets the BaseThemeName of the control.

    Declaration
    protected string BaseThemeName { get; set; }
    Property Value
    Type
    System.String

    CanApplyTheme

    Gets or sets a value indicating whether a theme style has been applied to the control.

    Declaration
    public bool CanApplyTheme { get; set; }
    Property Value
    Type Description
    System.Boolean

    The default value is true.

    CancelButton

    Gets or sets the Cancel button on the ColumnChooser

    Declaration
    public SfButton CancelButton { get; set; }
    Property Value
    Type
    SfButton

    CanOverrideStyle

    Gets or sets a value indicating whether control elements styles can be overridden by theme style settings.

    Declaration
    public bool CanOverrideStyle { get; set; }
    Property Value
    Type Description
    System.Boolean

    Default value is false.

    Remarks

    By default, the control's element styles will not be overridden by theme style settings if the style is set in sample level. If this property is enabled, element style will be overridden by theme style settings event if it is set in sample level. This property should be enabled or disabled before calling the ThemeName property of the control.

    CheckedListBox

    Gets or sets the CheckedListBox that displays the columns to choose.

    Declaration
    public SfListView CheckedListBox { get; set; }
    Property Value
    Type
    SfListView

    ColumnChooserLabel

    Gets or sets the column chooser label.

    Declaration
    public Label ColumnChooserLabel { get; set; }
    Property Value
    Type
    System.Windows.Forms.Label

    ControlName

    Gets the name of the control.

    Declaration
    public string ControlName { get; }
    Property Value
    Type
    System.String

    IsVisualStyleEnabled

    Gets a value indicating whether the visual style based theme is applied to the control and also indicates whether the theme files are referred from external assemblies or not.

    Declaration
    public bool IsVisualStyleEnabled { get; }
    Property Value
    Type Description
    System.Boolean

    Return true, if the visual style based theme is applied to the control. Otherwise returns false.

    OKButton

    Gets or sets the OK button on the ColumnChooser.

    Declaration
    public SfButton OKButton { get; set; }
    Property Value
    Type
    SfButton

    SearchTextBox

    Gets or sets the search textbox on the ColumnChooser

    Declaration
    public TextBoxExt SearchTextBox { get; set; }
    Property Value
    Type
    TextBoxExt

    ThemeName

    Gets or sets the theme name of the ColumnChooser control.

    Declaration
    public string ThemeName { get; set; }
    Property Value
    Type Description
    System.String

    The default value is null.

    Remarks

    The theme will be applied only when the particular theme for this control has included the Themes assembly.

    VisualTheme

    Gets or sets the visualTheme of the control, which holds the ThemeName applied from SkinManager

    Declaration
    protected string VisualTheme { get; set; }
    Property Value
    Type
    System.String

    Methods

    AddCancelButton()

    Add cancel button in the Column Chooser.

    Declaration
    protected virtual void AddCancelButton()

    AddCheckedListBox()

    Add checked listbox in the Column Chooser.

    Declaration
    protected virtual void AddCheckedListBox()

    AddColumnChooserLabel()

    Add the Column Chooser label to the column chooser control.

    Declaration
    protected virtual void AddColumnChooserLabel()

    AddOKButton()

    Add ok button in the Column Chooser.

    Declaration
    protected virtual void AddOKButton()

    AddSearchTextBox()

    Add search text box in the Column Chooser.

    Declaration
    protected virtual void AddSearchTextBox()

    Dispose(Boolean)

    Clean up any resources being used.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    true if managed resources should be disposed; otherwise, false.

    GetActiveThemeName()

    Gets the active theme name of the ColumnChooser control.

    Declaration
    public string GetActiveThemeName()
    Returns
    Type Description
    System.String

    Returns the active theme name.

    OnCancelButtonClick(Object, EventArgs)

    Occurs when cancel button is clicked.

    Declaration
    protected virtual void OnCancelButtonClick(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender

    Sender Object

    System.EventArgs e

    EvenArgs that contains event information

    OnCheckedListBoxItemChecked(Object, ItemCheckedEventArgs)

    Occurs when the checked state of any item in the CheckedListBox is changed.

    Declaration
    protected virtual void OnCheckedListBoxItemChecked(object sender, ItemCheckedEventArgs e)
    Parameters
    Type Name Description
    System.Object sender

    Sender Object

    ItemCheckedEventArgs e

    ItemCheckedEventArgs that contains event information

    OnClearSearchButtonClick(Object, EventArgs)

    Occurs when Clear Search icon in the SearchTextBox is clicked.

    Declaration
    protected virtual void OnClearSearchButtonClick(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender

    Sender Object

    System.EventArgs e

    EvenArgs that contains event information

    OnOKButtonClick(Object, EventArgs)

    Occurs when OK Button is clicked.

    Declaration
    protected virtual void OnOKButtonClick(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender

    Sender Object

    System.EventArgs e

    EvenArgs that contains event information

    OnSearchBoxTextChanged(Object, EventArgs)

    Occurs when any text is typed in the SearchTextBox.

    Declaration
    protected virtual void OnSearchBoxTextChanged(object sender, EventArgs e)
    Parameters
    Type Name Description
    System.Object sender

    Sender Object

    System.EventArgs e

    EvenArgs that contains event information

    ProcessTabKey(Boolean)

    Overridden to update the focus on the tab key press.

    Declaration
    protected override bool ProcessTabKey(bool forward)
    Parameters
    Type Name Description
    System.Boolean forward

    Specifies the tab navigating direction.

    Returns
    Type Description
    System.Boolean

    Returns true, if the control is selected otherwise return false.

    WndProc(ref Message)

    Processes Windows messages.

    Declaration
    protected override void WndProc(ref Message m)
    Parameters
    Type Name Description
    System.Windows.Forms.Message m

    The Windows System.Windows.Forms.Message to process.

    Events

    ThemeChanged

    Occurs when theme name of the ColumnChooser has changed.

    Declaration
    public event ThemeChangedEventHandler ThemeChanged
    Event Type
    Type
    ThemeChangedEventHandler

    ThemeNameChanged

    Occurs when theme name of the ColumnChooser has changed.

    Declaration
    public event ThemeChangedEventHandler ThemeNameChanged
    Event Type
    Type
    ThemeChangedEventHandler

    Explicit Interface Implementations

    IVisualStyle.VisualTheme

    Gets or sets the VisualTheme of the SfNumericTextBox control.

    Declaration
    string IVisualStyle.VisualTheme { get; set; }
    Returns
    Type
    System.String

    IThemeProvider.BaseThemeName

    Gets or sets the BaseTheme name of the theme

    Declaration
    string IThemeProvider.BaseThemeName { get; set; }
    Returns
    Type
    System.String

    Implements

    IThemeProvider
    IVisualStyle
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved