# GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.OnPreviewKeyDown

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_OnPreviewKeyDown_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.OnPreviewKeyDown*">OnPreviewKeyDown Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_OnPreviewKeyDown_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.OnPreviewKeyDown*"></a>
<h4 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_OnPreviewKeyDown_System_Windows_Input_KeyEventArgs_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.OnPreviewKeyDown(System.Windows.Input.KeyEventArgs)">OnPreviewKeyDown(KeyEventArgs)</h4>
<div class="markdown level1 summary"><p>Invoked when an unhandled <span class="xref">System.Windows.Input.Keyboard.PreviewKeyDown</span> attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">protected override void OnPreviewKeyDown(KeyEventArgs e)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Protected Overrides Sub OnPreviewKeyDown(e As KeyEventArgs)</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.input.keyeventargs">KeyEventArgs</a></td>
      <td><span class="parametername">e</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.input.keyeventargs">KeyEventArgs</a> that contains the event data.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="overrides">Overrides</h5>
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.uielement.onpreviewkeydown">UIElement.OnPreviewKeyDown(KeyEventArgs)</a></div>
<h5 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_OnPreviewKeyDown_System_Windows_Input_KeyEventArgs__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This implementation routes the key down event to the main content of the combo box, or the drop-down, depending on which is currently active.
The <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.OnPreviewKeyDown.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_OnPreviewKeyDown_System_Windows_Input_KeyEventArgs_">OnPreviewKeyDown(KeyEventArgs)</a> method is called before any event handler for the PreviewKeyDown event is called.
This method allows derived classes to handle the PreviewKeyDown event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
This implementation does not change the handled state (the Handled property) of the PreviewKeyDown event data.</p>
<p><b>Notes to Inheritors</b></p>
If you override <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcComboBox.OnPreviewKeyDown.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcComboBox_OnPreviewKeyDown_System_Windows_Input_KeyEventArgs_">OnPreviewKeyDown(KeyEventArgs)</a>, you can prevent registered delegates from receiving events by setting Handled to true.
</div>
</div>
