# FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_" data-uid="FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth*">GetPreferredColumnWidth Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_" data-uid="FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_System_Int32_" data-uid="FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth(System.Int32)">GetPreferredColumnWidth(int)</h4>
<div class="markdown level1 summary"><p>Gets the width of the widest cell (based on text content) in the specified column on this sheet.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public float GetPreferredColumnWidth(int column)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetPreferredColumnWidth(column As Integer) As Single</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">column</span></td>
      <td><p>Column index</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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><p>The minimum width necessary to display all the text within the specified column</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_" data-uid="FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_System_Int32_System_Boolean_" data-uid="FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth(System.Int32,System.Boolean)">GetPreferredColumnWidth(int, bool)</h4>
<div class="markdown level1 summary"><p>Gets the width of the widest cell (based on text content) in the specified column on this sheet.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public float GetPreferredColumnWidth(int column, bool ignoreHeaders)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetPreferredColumnWidth(column As Integer, ignoreHeaders As Boolean) As Single</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">column</span></td>
      <td><p>Column index</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">ignoreHeaders</span></td>
      <td><p>Whether to ignore column header cells</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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><p>The minimum width necessary to display all the text within the specified column</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_" data-uid="FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_System_Int32_System_Boolean_System_Boolean_" data-uid="FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth(System.Int32,System.Boolean,System.Boolean)">GetPreferredColumnWidth(int, bool, bool)</h4>
<div class="markdown level1 summary"><p>Gets the width of the widest cell (based on text content) in the specified column on this sheet.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public float GetPreferredColumnWidth(int column, bool ignoreHeaders, bool ignoreSpans)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetPreferredColumnWidth(column As Integer, ignoreHeaders As Boolean, ignoreSpans As Boolean) As Single</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">column</span></td>
      <td><p>Column index</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">ignoreHeaders</span></td>
      <td><p>Whether to ignore column header cells</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">ignoreSpans</span></td>
      <td><p>Whether to ignore spans</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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><p>The minimum width necessary to display all the text within the specified column</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_" data-uid="FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_System_Int32_System_Boolean_System_Boolean_System_Boolean_" data-uid="FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth(System.Int32,System.Boolean,System.Boolean,System.Boolean)">GetPreferredColumnWidth(int, bool, bool, bool)</h4>
<div class="markdown level1 summary"><p>Gets the width of the widest cell (based on text content) in the specified column on this sheet.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public float GetPreferredColumnWidth(int column, bool ignoreHeaders, bool ignoreSpans, bool excludeWordWrap)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetPreferredColumnWidth(column As Integer, ignoreHeaders As Boolean, ignoreSpans As Boolean, excludeWordWrap As Boolean) As Single</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">column</span></td>
      <td><p>Column index</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">ignoreHeaders</span></td>
      <td><p>Whether to ignore column header cells</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">ignoreSpans</span></td>
      <td><p>Whether to ignore spans</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">excludeWordWrap</span></td>
      <td><p>Whether to exclude cells with wrapped contents</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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><p>The minimum width necessary to display all the text within the specified column</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_System_Int32_System_Boolean_System_Boolean_System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>A cell has wrapped contents (text that wraps to multiple lines) when the renderer
in the composite style for the cell implements IWordWrapSupport interface and
its WordWrap property returns true.</p>
</div>


<a id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_" data-uid="FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_System_Int32_System_Boolean_System_Boolean_System_Boolean_System_Boolean_" data-uid="FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth(System.Int32,System.Boolean,System.Boolean,System.Boolean,System.Boolean)">GetPreferredColumnWidth(int, bool, bool, bool, bool)</h4>
<div class="markdown level1 summary"><p>Gets the width of the widest cell (based on text content) in the specified column on this sheet.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public float GetPreferredColumnWidth(int column, bool ignoreHeaders, bool ignoreSpans, bool excludeWordWrap, bool ignoreTable)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetPreferredColumnWidth(column As Integer, ignoreHeaders As Boolean, ignoreSpans As Boolean, excludeWordWrap As Boolean, ignoreTable As Boolean) As Single</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">column</span></td>
      <td><p>Column index</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">ignoreHeaders</span></td>
      <td><p>Whether to ignore column header cells</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">ignoreSpans</span></td>
      <td><p>Whether to ignore spans</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">excludeWordWrap</span></td>
      <td><p>Whether to exclude cells with wrapped contents</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">ignoreTable</span></td>
      <td><p>Whether to ignore measure cells in table can have special object likes table header filter button</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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><p>The minimum width necessary to display all the text within the specified column</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_System_Int32_System_Boolean_System_Boolean_System_Boolean_System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>A cell has wrapped contents (text that wraps to multiple lines) when the renderer
in the composite style for the cell implements IWordWrapSupport interface and
its WordWrap property returns true.</p>
</div>


<a id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_" data-uid="FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_System_Int32_FarPoint_Win_Spread_PreferredSizeColumnOptions_" data-uid="FarPoint.Win.Spread.SheetView.GetPreferredColumnWidth(System.Int32,FarPoint.Win.Spread.PreferredSizeColumnOptions)">GetPreferredColumnWidth(int, PreferredSizeColumnOptions)</h4>
<div class="markdown level1 summary"><p>Gets the width of the widest cell (based on text content) in the specified column on this sheet.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public float GetPreferredColumnWidth(int column, PreferredSizeColumnOptions flags)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetPreferredColumnWidth(column As Integer, flags As PreferredSizeColumnOptions) As Single</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">column</span></td>
      <td><p>Column index</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.Spread.PreferredSizeColumnOptions.html">PreferredSizeColumnOptions</a></td>
      <td><span class="parametername">flags</span></td>
      <td><p>Options when getting the preferred width</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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><p>The minimum width necessary to display all the text within the specified column</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="FarPoint_Win_Spread_SheetView_GetPreferredColumnWidth_System_Int32_FarPoint_Win_Spread_PreferredSizeColumnOptions__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>A cell has wrapped contents (text that wraps to multiple lines) when the renderer
in the composite style for the cell implements IWordWrapSupport interface and
its WordWrap property returns true.</p>
</div>
</div>
