# GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.Columns

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_Columns_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.Columns*">Columns Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_Columns_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.Columns*"></a>
<h4 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_Columns" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.Columns">Columns</h4>
<div class="markdown level1 summary"><p>Gets a collection that contains all the columns in the control.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ListColumnCollection Columns { get; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public ReadOnly Property Columns As ListColumnCollection</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.ListColumnCollection.html">ListColumnCollection</a></td>
      <td><p>The columns in the control.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_Columns_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p> 
    Use the <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.Columns.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_Columns">Columns</a> collection to add columns, remove columns, or update properties on the columns. 
    </p>
<p>
    Each column in the <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.Columns.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_Columns">Columns</a> collection defines a column in the <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.html">GcComboBox</a>.
    <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.Columns.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_Columns">Columns</a> in the collection must derive from GrapeCity.Windows.InputMan.ListColumn. 
    </p>
<p>
    The following table lists the three defined column types that the <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.html">GcComboBox</a> provides.
    <table width="50%" cellspacing="2" cellpadding="5" frame="lhs"><tr><th><p>Column type</p></th><th><p>Data type</p></th></tr><tr><td><p>GrapeCity.Windows.InputMan.ListTextColumn</p></td><td><p>Used to display text.</p></td></tr><tr><td><p>GrapeCity.Windows.InputMan.ListCheckBoxColumn</p></td><td><p>Used to display Boolean data.</p></td></tr><tr><td><p>GrapeCity.Windows.InputMan.ListImageColumn</p></td><td><p>Used to display image.</p></td></tr></table>
<p>
    In addition, you can define your own custom column by using GrapeCity.Windows.InputMan.ListTemplateColumn . 
    If you set <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.ListItem.html">ListItem</a> to <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.controls.itemscontrol.items">Items</a> or <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.controls.itemscontrol.itemssource">ItemsSource</a>, 
    the GrapeCity.Windows.InputMan.ListSubItemColumn is used to display <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.SubItem.html">SubItem</a> customized in <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.ListItem.SubItems.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_ListItem_SubItems">SubItems</a>.
    You can modify the <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.Columns.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_Columns">Columns</a> 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. 
    </p>
<p>
    You cannot add a column to the <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.Columns.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_Columns">Columns</a> collection of more than one GrapeCity.Windows.InputMan.GcComboBox. 
    If you try to do this, an <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a> will be thrown.
    </p>
</div>
<h5 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_Columns_examples">Examples</h5>
<p>The following code example demonstrates how to populate the <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.Columns.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_Columns">Columns</a> collection in XAML.
This example is part of a larger example available in the <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.html">GcComboBox</a> class overview.</p>

</div>
