# C1.Win.TrueDBGrid.C1TrueDBGrid.CellContaining

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_TrueDBGrid_C1TrueDBGrid_CellContaining_" data-uid="C1.Win.TrueDBGrid.C1TrueDBGrid.CellContaining*">CellContaining Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_TrueDBGrid_C1TrueDBGrid_CellContaining_" data-uid="C1.Win.TrueDBGrid.C1TrueDBGrid.CellContaining*"></a>
<h4 id="C1_Win_TrueDBGrid_C1TrueDBGrid_CellContaining_System_Int32_System_Int32_System_Int32__System_Int32__" data-uid="C1.Win.TrueDBGrid.C1TrueDBGrid.CellContaining(System.Int32,System.Int32,System.Int32@,System.Int32@)">CellContaining(int, int, out int, out int)</h4>
<div class="markdown level1 summary"><p>Returns the cell position for a set of coordinates.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool CellContaining(int x, int y, out int row, out int col)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CellContaining(x As Integer, y As Integer, ByRef row As Integer, ByRef col As Integer) As Boolean</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.int32">int</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>The x-coordinate.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>The y-coordinate.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">row</span></td>
      <td><p>The row under the coordinate pair.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">col</span></td>
      <td><p>The column index under the coordinate pair.</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.boolean">bool</a></td>
      <td><p>A value indicating whether a data cell is beneath the specified coordinate pair.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_TrueDBGrid_C1TrueDBGrid_CellContaining_System_Int32_System_Int32_System_Int32__System_Int32___remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The CellContaining method combines the <a class="xref" href="C1.Win.TrueDBGrid.C1TrueDBGrid.ColContaining.html#C1_Win_TrueDBGrid_C1TrueDBGrid_ColContaining_System_Int32_">ColContaining(int)</a> and <a class="xref" href="C1.Win.TrueDBGrid.C1TrueDBGrid.RowContaining.html#C1_Win_TrueDBGrid_C1TrueDBGrid_RowContaining_System_Int32_">RowContaining(int)</a> methods into one call. If the coordinate pair specified by x and y points to a data cell, this method returns True, and the rowindex and colindex arguments receive zero-based indexes that identify the cell.</p>
<p>This method is useful when working with mouse and drag events when trying to determine where the user clicked or dropped another control in terms of a grid cell.</p>
<p>If the specified coordinate is outside of the grid's data area, this method returns False. Use the <a class="xref" href="C1.Win.TrueDBGrid.C1TrueDBGrid.PointAt.html#C1_Win_TrueDBGrid_C1TrueDBGrid_PointAt_System_Int32_System_Int32_">PointAt(int, int)</a> method to determine what kind of grid element, if any, is beneath the specified coordinate.</p>
</div>
</div>
