# C1.Win.FlexGrid.C1FlexGridBase.OwnerDrawOutlineButton

## Content

<div class="doc-site-dotnet-api-container">




<h1 id="C1_Win_FlexGrid_C1FlexGridBase_OwnerDrawOutlineButton" data-uid="C1.Win.FlexGrid.C1FlexGridBase.OwnerDrawOutlineButton" class="text-break">OwnerDrawOutlineButton Event
</h1>
<div class="markdown level0 summary"><p>Fires before the grid draws a tree outline button, when the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.DrawMode.html#C1_Win_FlexGrid_C1FlexGridBase_DrawMode">DrawMode</a> property is set to <a class="xref" href="C1.Win.FlexGrid.DrawModeEnum.html#C1_Win_FlexGrid_DrawModeEnum_OwnerDraw">OwnerDraw</a>.</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_OwnerDrawOutlineButton_syntax">Syntax</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public event EventHandler&lt;OwnerDrawOutlineButtonEventArgs&gt; OwnerDrawOutlineButton</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Event OwnerDrawOutlineButton As EventHandler(Of OwnerDrawOutlineButtonEventArgs)</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="https://learn.microsoft.com/dotnet/api/system.eventhandler-1">EventHandler</a>&lt;<a class="xref" href="C1.Win.FlexGrid.OwnerDrawOutlineButtonEventArgs.html">OwnerDrawOutlineButtonEventArgs</a>&gt;</td>
      <td>Fires before the grid draws a tree outline button, when the  property is set to .</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_OwnerDrawOutlineButton_remarks"><strong>Remarks</strong></h5>
<div class="markdown level0 remarks"><p>The <b>OnOwnerDrawOutlineButton</b> event only fires when the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.DrawMode.html#C1_Win_FlexGrid_C1FlexGridBase_DrawMode">DrawMode</a> property is 
set to <a class="xref" href="C1.Win.FlexGrid.DrawModeEnum.html#C1_Win_FlexGrid_DrawModeEnum_OwnerDraw">OwnerDraw</a>.</p>
<p>You can use this event to customize the appearance of tree outline button in the grid. 
The event allows three main types of customization:</p>
<ol><li><span class="term"></span>
Change the value of the <b>Text</b> and <b>Image</b> parameters to modify the values displayed 
by the grid. You can use this type of customization to replace level strings with + or - symbols, 
for example.</li><li><span class="term"></span>
Change the <b>Style</b> property to display the outline button using a different style than the one 
selected by the grid by default.</li><li><span class="term"></span>
Use the <b>Graphics</b> and <b>Bounds</b> parameters and draw the tree outline button yourself. When drawing 
outline buttons this way, you may call the <a class="xref" href="C1.Win.FlexGrid.OwnerDrawOutlineButtonEventArgs.DrawOutlineButton.html#C1_Win_FlexGrid_OwnerDrawOutlineButtonEventArgs_DrawOutlineButton_C1_Win_FlexGrid_DrawCellFlags_">DrawOutlineButton(DrawCellFlags)</a> member to force 
the grid to draw specific parts of the outline button, while your code draws other parts. For example, 
you could paint a custom background and then call <b>DrawCell</b> to have the grid paint the outline button
border and contents.
</li></ol>
</div>
</div>
