# C1.WPF.FlexGrid.C1FlexGrid.HitTest

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_FlexGrid_C1FlexGrid_HitTest_" data-uid="C1.WPF.FlexGrid.C1FlexGrid.HitTest*">HitTest Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_FlexGrid_C1FlexGrid_HitTest_" data-uid="C1.WPF.FlexGrid.C1FlexGrid.HitTest*"></a>
<h4 id="C1_WPF_FlexGrid_C1FlexGrid_HitTest_System_Windows_RoutedEventArgs_" data-uid="C1.WPF.FlexGrid.C1FlexGrid.HitTest(System.Windows.RoutedEventArgs)">HitTest(RoutedEventArgs)</h4>
<div class="markdown level1 summary"><p>Gets a <a class="xref" href="C1.WPF.FlexGrid.HitTestInfo.html">HitTestInfo</a> object that contains information about the
grid at a given location.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public HitTestInfo HitTest(RoutedEventArgs e)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function HitTest(e As RoutedEventArgs) As HitTestInfo</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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.input.mouseeventargs">MouseEventArgs</a> that specifies the point to be tested.</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.FlexGrid.HitTestInfo.html">HitTestInfo</a></td>
      <td><p>A <a class="xref" href="C1.WPF.FlexGrid.HitTestInfo.html">HitTestInfo</a> object that contains information about the
grid at the location specified by the <code class="paramref">e</code> parameter.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_FlexGrid_C1FlexGrid_HitTest_System_Windows_RoutedEventArgs__examples">Examples</h5>
<p>The code below handles the <b>MouseMove</b> event and shows the coordinates
and content of the cell under the mouse.</p>
<pre><code class="lang-csharp">void _flex_MouseMove(object sender, MouseEventArgs e)
{
    var ht = _flex.HitTest(e);
    _tb.Text = string.Format(
        "HitTest:: cell type {0}, row {1}, column {2}, content '{3}'", 
        ht.CellType, // e.g. Cell, ColumnHeader, RowHeader
        ht.Row, 
        ht.Column, 
        ht.CellRange.IsValid ? _flex[ht.Row, ht.Column] : "n/a");
}</code></pre>



<a id="C1_WPF_FlexGrid_C1FlexGrid_HitTest_" data-uid="C1.WPF.FlexGrid.C1FlexGrid.HitTest*"></a>
<h4 id="C1_WPF_FlexGrid_C1FlexGrid_HitTest_System_Windows_Point_" data-uid="C1.WPF.FlexGrid.C1FlexGrid.HitTest(System.Windows.Point)">HitTest(Point)</h4>
<div class="markdown level1 summary"><p>Gets a <a class="xref" href="C1.WPF.FlexGrid.HitTestInfo.html">HitTestInfo</a> object that contains information about the
grid at a given location.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public HitTestInfo HitTest(Point point)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function HitTest(point As Point) As HitTestInfo</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.point">Point</a></td>
      <td><span class="parametername">point</span></td>
      <td><pre><code>&lt;xref href=&quot;System.Windows.Point&quot; data-throw-if-not-resolved=&quot;false&quot;&gt;&lt;/xref&gt;, in control coordinates, that specifies
</code></pre>
<p>the position to be tested.</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.FlexGrid.HitTestInfo.html">HitTestInfo</a></td>
      <td><p>A <a class="xref" href="C1.WPF.FlexGrid.HitTestInfo.html">HitTestInfo</a> object that contains information about the
grid at the location specified by the <code class="paramref">point</code> parameter.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_FlexGrid_C1FlexGrid_HitTest_System_Windows_Point__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>For more details and an example, please see <span class="xref">HitTest(MouseEventArgs)</span>.</p>
</div>
</div>
