# GrapeCity.Win.Spread.InputMan.CellType.EditBase.GetPreferredSize

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Win_Spread_InputMan_CellType_EditBase_GetPreferredSize_" data-uid="GrapeCity.Win.Spread.InputMan.CellType.EditBase.GetPreferredSize*">GetPreferredSize Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Win_Spread_InputMan_CellType_EditBase_GetPreferredSize_" data-uid="GrapeCity.Win.Spread.InputMan.CellType.EditBase.GetPreferredSize*"></a>
<h4 id="GrapeCity_Win_Spread_InputMan_CellType_EditBase_GetPreferredSize_System_Drawing_Size_" data-uid="GrapeCity.Win.Spread.InputMan.CellType.EditBase.GetPreferredSize(System.Drawing.Size)">GetPreferredSize(Size)</h4>
<div class="markdown level1 summary"><p>Retrieves the size of a rectangular area into which a control can fit.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public override Size GetPreferredSize(Size proposedSize)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overrides Function GetPreferredSize(proposedSize As Size) As Size</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.size">Size</a></td>
      <td><span class="parametername">proposedSize</span></td>
      <td><p>The custom-sized area for a control.</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.drawing.size">Size</a></td>
      <td><p>An ordered pair of type <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.size">Size</a> objects that represent the width and height of a rectangle.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="overrides">Overrides</h5>
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control.getpreferredsize">Control.GetPreferredSize(Size)</a></div>
<h5 id="GrapeCity_Win_Spread_InputMan_CellType_EditBase_GetPreferredSize_System_Drawing_Size__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The behavior of GetPreferredSize differs by control. The LayoutEngine might be unable to assign the returned size to the control. You can return a size larger than the constraints indicated in the proposedSize parameter, but proposedSize should decrease as the constraint decreases. For example, GetPreferredSize(new Size(100, 0)) should not be wider than GetPreferredSize(new Size(200, 0)). The exception is a proposedSize of 0 or Size.Empty, which is defined as unconstrained.</p>
</div>
</div>
