# C1.Win.FlexGrid.C1FlexGridBase.AutoSizeRows

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_C1FlexGridBase_AutoSizeRows_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.AutoSizeRows*">AutoSizeRows Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_C1FlexGridBase_AutoSizeRows_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.AutoSizeRows*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_AutoSizeRows_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_C1_Win_FlexGrid_AutoSizeFlags_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.AutoSizeRows(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,C1.Win.FlexGrid.AutoSizeFlags)">AutoSizeRows(int, int, int, int, int, AutoSizeFlags)</h4>
<div class="markdown level1 summary"><p>Adjusts the height of a row range to fit the data in a cell range.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual void AutoSizeRows(int topRow, int leftCol, int bottomRow, int rightCol, int extraSpace, AutoSizeFlags flags)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Sub AutoSizeRows(topRow As Integer, leftCol As Integer, bottomRow As Integer, rightCol As Integer, extraSpace As Integer, flags As AutoSizeFlags)</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">topRow</span></td>
      <td><p>Top row in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">leftCol</span></td>
      <td><p>Left column in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">bottomRow</span></td>
      <td><p>Bottom row in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">rightCol</span></td>
      <td><p>Right column in the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">extraSpace</span></td>
      <td><p>Amount of extra space, in pixels, to add to the row heights.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Win.FlexGrid.AutoSizeFlags.html">AutoSizeFlags</a></td>
      <td><span class="parametername">flags</span></td>
      <td><p>Flags that control auto-sizing options.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_FlexGrid_C1FlexGridBase_AutoSizeRows_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.AutoSizeRows*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_AutoSizeRows" data-uid="C1.Win.FlexGrid.C1FlexGridBase.AutoSizeRows">AutoSizeRows()</h4>
<div class="markdown level1 summary"><p>Adjusts the height of all rows to fit the data.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual void AutoSizeRows()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Sub AutoSizeRows()</code></pre>
</div>


<a id="C1_Win_FlexGrid_C1FlexGridBase_AutoSizeRows_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.AutoSizeRows*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_AutoSizeRows_System_Drawing_Graphics_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_C1_Win_FlexGrid_AutoSizeFlags_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.AutoSizeRows(System.Drawing.Graphics,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,C1.Win.FlexGrid.AutoSizeFlags)">AutoSizeRows(Graphics, int, int, int, int, int, AutoSizeFlags)</h4>
<div class="markdown level1 summary"><p>Automatically size grid columns to fit the largest entry.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">protected virtual void AutoSizeRows(Graphics g, int row1, int col1, int row2, int col2, int extra, AutoSizeFlags flags)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Protected Overridable Sub AutoSizeRows(g As Graphics, row1 As Integer, col1 As Integer, row2 As Integer, col2 As Integer, extra As Integer, flags As AutoSizeFlags)</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.drawing.graphics">Graphics</a></td>
      <td><span class="parametername">g</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.graphics">Graphics</a> object used to measure the cell contents.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">row1</span></td>
      <td><p>Index of the first row to be measured.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">col1</span></td>
      <td><p>Index of the first column to be measured.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">row2</span></td>
      <td><p>Index of the last row to be measured.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">col2</span></td>
      <td><p>Index of the first column to be measured.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">extra</span></td>
      <td><p>Extra space, in twips, to add to the largest entry.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Win.FlexGrid.AutoSizeFlags.html">AutoSizeFlags</a></td>
      <td><span class="parametername">flags</span></td>
      <td><p><a class="xref" href="C1.Win.FlexGrid.AutoSizeFlags.html">AutoSizeFlags</a> value that specifies auto-sizing behavior.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_AutoSizeRows_System_Drawing_Graphics_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_C1_Win_FlexGrid_AutoSizeFlags__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method is for internal use. It allows inherited classes to customize the grid appearance.</p>
</div>
</div>
