# C1.Win.FlexGrid.OwnerDrawCellEventArgs.DrawCell

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_OwnerDrawCellEventArgs_DrawCell_" data-uid="C1.Win.FlexGrid.OwnerDrawCellEventArgs.DrawCell*">DrawCell Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_OwnerDrawCellEventArgs_DrawCell_" data-uid="C1.Win.FlexGrid.OwnerDrawCellEventArgs.DrawCell*"></a>
<h4 id="C1_Win_FlexGrid_OwnerDrawCellEventArgs_DrawCell_C1_Win_FlexGrid_DrawCellFlags_" data-uid="C1.Win.FlexGrid.OwnerDrawCellEventArgs.DrawCell(C1.Win.FlexGrid.DrawCellFlags)">DrawCell(DrawCellFlags)</h4>
<div class="markdown level1 summary"><p>Causes the grid to paint parts of the cell (background, foreground, border, etc.)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DrawCell(DrawCellFlags flags)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub DrawCell(flags As DrawCellFlags)</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="C1.Win.FlexGrid.DrawCellFlags.html">DrawCellFlags</a></td>
      <td><span class="parametername">flags</span></td>
      <td><p><a class="xref" href="C1.Win.FlexGrid.DrawCellFlags.html">DrawCellFlags</a> that specifies the parts of the cell.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_OwnerDrawCellEventArgs_DrawCell_C1_Win_FlexGrid_DrawCellFlags__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method is typically called in <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.OwnerDrawCell.html">OwnerDrawCell</a> handlers when the code
intends to draw some elements of the cell but not everything.</p>
<p>For example, the code may want to draw a custom border only. In this case, it could call
<b>e.DrawCell(DrawCellFlags.Background | DrawCellFlags.Content)</b> to draw the cell background and content, 
and later draw the custom border. 
Or the code could want to draw a custom marker in a cell (like a note indicator in Excel). In this case, it 
should call <b>e.DrawCell()</b> to draw the entire cell, and later add the note marker (little red triangle 
on the top right corner of the cell).</p>
<p>If the owner-draw code draws the entire cell (including the background), then there's no need to call 
<b>e.DrawCell</b> at all.</p>
</div>


<a id="C1_Win_FlexGrid_OwnerDrawCellEventArgs_DrawCell_" data-uid="C1.Win.FlexGrid.OwnerDrawCellEventArgs.DrawCell*"></a>
<h4 id="C1_Win_FlexGrid_OwnerDrawCellEventArgs_DrawCell" data-uid="C1.Win.FlexGrid.OwnerDrawCellEventArgs.DrawCell">DrawCell()</h4>
<div class="markdown level1 summary"><p>Causes the grid to paint the whole cell.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DrawCell()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub DrawCell()</code></pre>
</div>
</div>
