# C1.Win.FlexGrid.C1FlexGridBase.Editor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_C1FlexGridBase_Editor_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Editor*">Editor Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_C1FlexGridBase_Editor_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Editor*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_Editor" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Editor">Editor</h4>
<div class="markdown level1 summary"><p>Gets or sets a reference to the cell editor that is currently active.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Browsable(false)]
public Control Editor { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">&lt;Browsable(False)&gt;
Public Property Editor As Control</code></pre>
</div>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_Editor_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.Editor.html#C1_Win_FlexGrid_C1FlexGridBase_Editor">Editor</a> property returns a reference to the cell editor that is 
currently active. This may be one of the built-in editors (a TextBox, a ComboBox, or a 
DateTimePicker control), a custom editor, or null (if the grid is not in edit mode).</p>
<p>You can use this property to programmatically access the editor, or to find out 
if the grid is in edit mode.</p>
<p>If you don't want to use the grid's built-in editors, you can use any other control 
instead. To do this, either associate the external editor with a specific grid row, column, 
or <a class="xref" href="C1.Win.FlexGrid.CellStyle.html">CellStyle</a> using the <a class="xref" href="C1.Win.FlexGrid.CellStyle.Editor.html#C1_Win_FlexGrid_CellStyle_Editor">Editor</a> property, which you can 
get and set at any time.</p>
<p>Alternatively, you can handle the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.StartEdit.html">StartEdit</a> event and assign any control 
directly to the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.Editor.html#C1_Win_FlexGrid_C1FlexGridBase_Editor">Editor</a> property. (Note that the grid's Editor property can only 
be assigned while handling the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.StartEdit.html">StartEdit</a> event, and is automatically reset to 
null when the grid exits edit mode.)</p>
<p>Any control can be used as an external editor, but to achieve complete integration with 
the grid, the external editor should implement the <span class="xref">C1.Win.IEmbeddedEditor</span> interface. Some controls 
implement this interface natively and don't require any extra code to be used as grid editors 
(like the ones in the C1Input library). Most, however, will require you to implement at least 
a few of the methods in <span class="xref">C1.Win.IEmbeddedEditor</span>.</p>
<p>For examples of custom editors, please see Using Custom Editors and Creating Custom Editors 
in this documentation, or visit our on-line sample library at https://www.grapecity.com/en/samples
and download the "CustomEditors" sample.</p>
</div>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_Editor_examples">Examples</h5>
<p>The code below uses the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.SetupEditor.html">SetupEditor</a> event to customize the current editor
by setting two properties.</p>
<pre><code class="lang-csharp">void _flex_SetupEditor(object sender, C1.Win.FlexGrid.RowColEventArgs e)
{
    TextBox tb = _flex.Editor as TextBox;
    if (tb != null)
    {
        tb.CharacterCasing = CharacterCasing.Upper;
        tb.MaxLength = 12;
    }
}</code></pre>

</div>
