# C1.Win.FlexGrid.C1FlexGridBase.SetupEditor

## Content

<div class="doc-site-dotnet-api-container">




<h1 id="C1_Win_FlexGrid_C1FlexGridBase_SetupEditor" data-uid="C1.Win.FlexGrid.C1FlexGridBase.SetupEditor" class="text-break">SetupEditor Event
</h1>
<div class="markdown level0 summary"><p>Fires after a cell editor has been initialized by the grid, to allow additional custom initialization.</p>
</div>
<div class="markdown level0 conceptual"></div>
<h6><strong>Namespace</strong>: <a class="xref" href="C1.Win.FlexGrid.html">C1.Win.FlexGrid</a></h6>
<h6><strong>Assembly</strong>: C1.Win.FlexGrid.10.dll</h6>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_SetupEditor_syntax">Syntax</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public event RowColEventHandler SetupEditor</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Event SetupEditor As RowColEventHandler</code></pre>
</div>
<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="C1.Win.FlexGrid.RowColEventHandler.html">RowColEventHandler</a></td>
      <td>Fires after a cell editor has been initialized by the grid, to allow additional custom initialization.</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_SetupEditor_remarks"><strong>Remarks</strong></h5>
<div class="markdown level0 remarks"><p>This event can be used to customize the behavior of the cell editor by setting properties
on the editor control.</p>
<p>For example, the code below checks to see if the editor being used is a TextBox, and then
sets the editor's CharacterCasing and MaxLength properties.</p>
<pre><code class="lang-csharp">void _flex_SetupEditor(object sender, RowColEventArgs e)
{
    TextBox tb = _flex.Editor as TextBox;
    if (tb != null)
    {
        if (_flex.Cols[e.Col].Name == "ID")
            tb.MaxLength = 4;
        else
            tb.MaxLength = 32000;
    }
}</code></pre>
</div>
</div>
