# C1.WPF.Excel.XLColumnCollection

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_WPF_Excel_XLColumnCollection" data-uid="C1.WPF.Excel.XLColumnCollection" class="text-break">XLColumnCollection Class
</h1>
  <div class="markdown level0 summary"><p>Represents a collection of <a class="xref" href="C1.WPF.Excel.XLColumn.html">XLColumn</a> objects that represent the
individual columns in each <a class="xref" href="C1.WPF.Excel.XLSheet.html">XLSheet</a>.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">XLColumnCollection</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.ienumerable">IEnumerable</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.WPF.Excel.html">C1.WPF.Excel</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.Excel.4.6.2.dll</h6>
  <h5 id="C1_WPF_Excel_XLColumnCollection_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class XLColumnCollection : IEnumerable</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class XLColumnCollection
    Implements IEnumerable</code></pre>
  </div>
  <h5 id="C1_WPF_Excel_XLColumnCollection_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><pre><code>&lt;p&gt;The collection has methods for counting, enumerating, adding, and removing 
</code></pre>
<p>columns from the collection.</p>
<p>The <a class="xref" href="C1.WPF.Excel.XLColumn.html">XLColumn</a> objects do not contain any data. If you remove
a column from the collection, the data will be lost. If you later re-insert that
same column back into the collection, the column will be blank.</p>
</div>
  <h5 id="C1_WPF_Excel_XLColumnCollection_examples"><strong>Examples</strong></h5>
  <p>Note that you can create columns automatically by using the sheet's indexer.
For example, the following code retrieves the cell at coordinates (3,3)
and in doing so automatically creates four rows and four columns automatically:</p>
<pre><code class="lang-csharp">C1XLBook book  = new C1XLBook();
XLSheet  sheet = book.Sheets[0];
XLCell   cell  = sheet[3,3]; // creates 4 rows and 4 columns</code></pre>

  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_Book" data-uid="C1.WPF.Excel.XLColumnCollection.Book">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.Book.html#C1_WPF_Excel_XLColumnCollection_Book">Book</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a reference to the parent <a class="xref" href="C1.WPF.Excel.C1XLBook.html">C1XLBook</a> object.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_Count" data-uid="C1.WPF.Excel.XLColumnCollection.Count">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.Count.html#C1_WPF_Excel_XLColumnCollection_Count">Count</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the number of items in the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_Frozen" data-uid="C1.WPF.Excel.XLColumnCollection.Frozen">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.Frozen.html#C1_WPF_Excel_XLColumnCollection_Frozen">Frozen</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the number of frozen columns in the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_Item_System_Int32_" data-uid="C1.WPF.Excel.XLColumnCollection.Item(System.Int32)">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.Item.html#C1_WPF_Excel_XLColumnCollection_Item_System_Int32_">this[int]</a>
        </td>
        <td class="markdown level1 summary"><p>Returns a reference to the <a class="xref" href="C1.WPF.Excel.XLColumn.html">XLColumn</a> object at the specified
index.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_Sheet" data-uid="C1.WPF.Excel.XLColumnCollection.Sheet">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.Sheet.html#C1_WPF_Excel_XLColumnCollection_Sheet">Sheet</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a reference to the parent <a class="xref" href="C1.WPF.Excel.XLSheet.html">XLSheet</a> object.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_Add" data-uid="C1.WPF.Excel.XLColumnCollection.Add">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.Add.html#C1_WPF_Excel_XLColumnCollection_Add">Add()</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a new <a class="xref" href="C1.WPF.Excel.XLColumn.html">XLColumn</a> object and adds it to the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_Add_C1_WPF_Excel_XLColumn_" data-uid="C1.WPF.Excel.XLColumnCollection.Add(C1.WPF.Excel.XLColumn)">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.Add.html#C1_WPF_Excel_XLColumnCollection_Add_C1_WPF_Excel_XLColumn_">Add(XLColumn)</a>
        </td>
        <td class="markdown level1 summary"><p>Adds an <a class="xref" href="C1.WPF.Excel.XLColumn.html">XLColumn</a> object to the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_Clear" data-uid="C1.WPF.Excel.XLColumnCollection.Clear">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.Clear.html#C1_WPF_Excel_XLColumnCollection_Clear">Clear()</a>
        </td>
        <td class="markdown level1 summary"><p>Removes all items from the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_Contains_C1_WPF_Excel_XLColumn_" data-uid="C1.WPF.Excel.XLColumnCollection.Contains(C1.WPF.Excel.XLColumn)">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.Contains.html#C1_WPF_Excel_XLColumnCollection_Contains_C1_WPF_Excel_XLColumn_">Contains(XLColumn)</a>
        </td>
        <td class="markdown level1 summary"><p>Determines whether an <a class="xref" href="C1.WPF.Excel.XLColumn.html">XLColumn</a> is a member of the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_IndexOf_C1_WPF_Excel_XLColumn_" data-uid="C1.WPF.Excel.XLColumnCollection.IndexOf(C1.WPF.Excel.XLColumn)">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.IndexOf.html#C1_WPF_Excel_XLColumnCollection_IndexOf_C1_WPF_Excel_XLColumn_">IndexOf(XLColumn)</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the index of a given <a class="xref" href="C1.WPF.Excel.XLRow.html">XLRow</a> object in the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_Insert_System_Int32_" data-uid="C1.WPF.Excel.XLColumnCollection.Insert(System.Int32)">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.Insert.html#C1_WPF_Excel_XLColumnCollection_Insert_System_Int32_">Insert(int)</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a new <a class="xref" href="C1.WPF.Excel.XLColumn.html">XLColumn</a> object and inserts it at a
specific position in the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_Insert_System_Int32_C1_WPF_Excel_XLColumn_" data-uid="C1.WPF.Excel.XLColumnCollection.Insert(System.Int32,C1.WPF.Excel.XLColumn)">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.Insert.html#C1_WPF_Excel_XLColumnCollection_Insert_System_Int32_C1_WPF_Excel_XLColumn_">Insert(int, XLColumn)</a>
        </td>
        <td class="markdown level1 summary"><p>Inserts an <a class="xref" href="C1.WPF.Excel.XLColumn.html">XLColumn</a> object at a specific position in the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_Insert_System_Int32_C1_WPF_Excel_XLColumn_C1_WPF_Excel_XLCell___" data-uid="C1.WPF.Excel.XLColumnCollection.Insert(System.Int32,C1.WPF.Excel.XLColumn,C1.WPF.Excel.XLCell[])">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.Insert.html#C1_WPF_Excel_XLColumnCollection_Insert_System_Int32_C1_WPF_Excel_XLColumn_C1_WPF_Excel_XLCell___">Insert(int, XLColumn, XLCell[])</a>
        </td>
        <td class="markdown level1 summary"><p>Inserts an <a class="xref" href="C1.WPF.Excel.XLColumn.html">XLColumn</a> object at a specific position in the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_Remove_C1_WPF_Excel_XLColumn_" data-uid="C1.WPF.Excel.XLColumnCollection.Remove(C1.WPF.Excel.XLColumn)">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.Remove.html#C1_WPF_Excel_XLColumnCollection_Remove_C1_WPF_Excel_XLColumn_">Remove(XLColumn)</a>
        </td>
        <td class="markdown level1 summary"><p>Removes an <a class="xref" href="C1.WPF.Excel.XLColumn.html">XLColumn</a> object from the collection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLColumnCollection_RemoveAt_System_Int32_" data-uid="C1.WPF.Excel.XLColumnCollection.RemoveAt(System.Int32)">
          <a class="xref" href="C1.WPF.Excel.XLColumnCollection.RemoveAt.html#C1_WPF_Excel_XLColumnCollection_RemoveAt_System_Int32_">RemoveAt(int)</a>
        </td>
        <td class="markdown level1 summary"><p>Removes the <a class="xref" href="C1.WPF.Excel.XLColumn.html">XLColumn</a> object at a given position from the collection.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
