[]
Gets a collection that contains all the columns in the control.
public ListColumnCollection Columns { get; }
Public ReadOnly Property Columns As ListColumnCollection
Type | Description |
---|---|
ListColumnCollection | The columns in the control. |
Use the Columns collection to add columns, remove columns, or update properties on the columns.
Each column in the Columns collection defines a column in the GcComboBox. Columns in the collection must derive from GrapeCity.Windows.InputMan.ListColumn.
The following table lists the three defined column types that the GcComboBox provides.
Column type | Data type |
---|---|
GrapeCity.Windows.InputMan.ListTextColumn | Used to display text. |
GrapeCity.Windows.InputMan.ListCheckBoxColumn | Used to display Boolean data. |
GrapeCity.Windows.InputMan.ListImageColumn | Used to display image. |
In addition, you can define your own custom column by using GrapeCity.Windows.InputMan.ListTemplateColumn . If you set ListItem to Items or ItemsSource, the GrapeCity.Windows.InputMan.ListSubItemColumn is used to display SubItem customized in SubItems. You can modify the Columns collection at run time regardless of whether it contains generated columns. However, if you specify columns in XAML, you should not set GrapeCity.Windows.InputMan.GcComboBox.AutoGenerateColumns to true.
You cannot add a column to the Columns collection of more than one GrapeCity.Windows.InputMan.GcComboBox. If you try to do this, an InvalidOperationException will be thrown.
The following code example demonstrates how to populate the Columns collection in XAML. This example is part of a larger example available in the GcComboBox class overview.