# C1.WPF.Grid.FlexGrid.GetCellAtPosition

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_Grid_FlexGrid_GetCellAtPosition_" data-uid="C1.WPF.Grid.FlexGrid.GetCellAtPosition*">GetCellAtPosition Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_Grid_FlexGrid_GetCellAtPosition_" data-uid="C1.WPF.Grid.FlexGrid.GetCellAtPosition*"></a>
<h4 id="C1_WPF_Grid_FlexGrid_GetCellAtPosition_System_Windows_RoutedEventArgs_" data-uid="C1.WPF.Grid.FlexGrid.GetCellAtPosition(System.Windows.RoutedEventArgs)">GetCellAtPosition(RoutedEventArgs)</h4>
<div class="markdown level1 summary"><p>Gets the cell at the specified pointer position.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public (GridCellType cellType, GridCellRange range) GetCellAtPosition(RoutedEventArgs e)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetCellAtPosition(e As RoutedEventArgs) As (cellType As GridCellType, range As GridCellRange)</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.windows.routedeventargs">RoutedEventArgs</a></td>
      <td><span class="parametername">e</span></td>
      <td><p>The pointer event that is used to get the position.</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="C1.WPF.Grid.GridCellType.html">GridCellType</a> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.valuetuple-c1.wpf.grid.gridcelltype,c1.wpf.grid.gridcellrange-.celltype">cellType</a>, <a class="xref" href="C1.WPF.Grid.GridCellRange.html">GridCellRange</a> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.valuetuple-c1.wpf.grid.gridcelltype,c1.wpf.grid.gridcellrange-.range">range</a>)</td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_Grid_FlexGrid_GetCellAtPosition_System_Windows_RoutedEventArgs__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Unlike <a class="xref" href="C1.WPF.Grid.FlexGrid.HitTest.html#C1_WPF_Grid_FlexGrid_HitTest_System_Windows_RoutedEventArgs_">HitTest(RoutedEventArgs)</a> method, this doesn't intercept cell elements but calculates the position from the model, and it doesn't honor cell-merging.</p>
</div>


<a id="C1_WPF_Grid_FlexGrid_GetCellAtPosition_" data-uid="C1.WPF.Grid.FlexGrid.GetCellAtPosition*"></a>
<h4 id="C1_WPF_Grid_FlexGrid_GetCellAtPosition_System_Windows_Point_" data-uid="C1.WPF.Grid.FlexGrid.GetCellAtPosition(System.Windows.Point)">GetCellAtPosition(Point)</h4>
<div class="markdown level1 summary"><p>Gets the cell at the specified pointer position.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public (GridCellType cellType, GridCellRange range) GetCellAtPosition(Point pt)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetCellAtPosition(pt As Point) As (cellType As GridCellType, range As GridCellRange)</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><span class="xref">Point</span></td>
      <td><span class="parametername">pt</span></td>
      <td><p>The position.</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="C1.WPF.Grid.GridCellType.html">GridCellType</a> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.valuetuple-c1.wpf.grid.gridcelltype,c1.wpf.grid.gridcellrange-.celltype">cellType</a>, <a class="xref" href="C1.WPF.Grid.GridCellRange.html">GridCellRange</a> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.valuetuple-c1.wpf.grid.gridcelltype,c1.wpf.grid.gridcellrange-.range">range</a>)</td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_Grid_FlexGrid_GetCellAtPosition_System_Windows_Point__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Unlike <a class="xref" href="C1.WPF.Grid.FlexGrid.HitTest.html#C1_WPF_Grid_FlexGrid_HitTest_System_Windows_RoutedEventArgs_">HitTest(RoutedEventArgs)</a> method, this doesn't intercept cell elements but calculates the position from the model, and it doesn't honor cell-merging.</p>
</div>
</div>
