# C1.C1Preview.TableVectorCollection.GetVectorSize

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_C1Preview_TableVectorCollection_GetVectorSize_" data-uid="C1.C1Preview.TableVectorCollection.GetVectorSize*">GetVectorSize Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_C1Preview_TableVectorCollection_GetVectorSize_" data-uid="C1.C1Preview.TableVectorCollection.GetVectorSize*"></a>
<h4 id="C1_C1Preview_TableVectorCollection_GetVectorSize_System_Int32_" data-uid="C1.C1Preview.TableVectorCollection.GetVectorSize(System.Int32)">GetVectorSize(int)</h4>
<div class="markdown level1 summary"><p>Returns the size (height for rows, width for columns) of a <a class="xref" href="C1.C1Preview.TableVector.html">TableVector</a>
(row or column) identified by its index in a <a class="xref" href="C1.C1Preview.RenderTable.html">RenderTable</a>.
This method does not create the specified vector if it has not been initialized
(see <b>remarks</b> for details).</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public LengthBase GetVectorSize(int index)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetVectorSize(index As Integer) As LengthBase</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">index</span></td>
      <td><p>The 0-based index (<a class="xref" href="C1.C1Preview.TableVector.Ordinal.html#C1_C1Preview_TableVector_Ordinal">Ordinal</a>) of the row or column.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="xref">LengthBase</span></td>
      <td><p>The height or width of the row or column.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_C1Preview_TableVectorCollection_GetVectorSize_System_Int32__remarks">Remarks</h5>
<div class="markdown level1 remarks"><pre><code>&lt;p&gt;
</code></pre>
<p>Because elements of a <a class="xref" href="C1.C1Preview.RenderTable.html">RenderTable</a>'s collections (cells, rows and columns)
are physically created &quot;on demand&quot; only when they are accessed via collections'
indexer properties, using this method is more efficient when you only need
to test the height/width of a row/column without creating it.</p>

    <p>
For instance, the following code physically creates a <a class="xref" href="C1.C1Preview.TableRow.html">TableRow</a> object
before testing its height:
</p>
<pre><code>&lt;pre&gt;&lt;code class=&quot;lang-csharp&quot;&gt;RenderTable rt = new RenderTable();
if (rt.Rows[10].Height == Unit.Auto)
  doSomething();&lt;/code&gt;&lt;/pre&gt;
</code></pre>
<p>At the same time, the following code does not cause a physical row object to be created,
while being functionally identical to the code above:</p>
<pre><code class="lang-csharp">RenderTable rt = new RenderTable();
if (rt.Rows.GetVectorSize(10) == Unit.Auto)
  doSomething();</code></pre>
</div>
</div>
