# GrapeCity.Win.Spread.InputMan.CellType.CalculatorButtonMappingCollection.Insert

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Win_Spread_InputMan_CellType_CalculatorButtonMappingCollection_Insert_" data-uid="GrapeCity.Win.Spread.InputMan.CellType.CalculatorButtonMappingCollection.Insert*">Insert Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Win_Spread_InputMan_CellType_CalculatorButtonMappingCollection_Insert_" data-uid="GrapeCity.Win.Spread.InputMan.CellType.CalculatorButtonMappingCollection.Insert*"></a>
<h4 id="GrapeCity_Win_Spread_InputMan_CellType_CalculatorButtonMappingCollection_Insert_System_Int32_System_Windows_Forms_Keys_System_String_" data-uid="GrapeCity.Win.Spread.InputMan.CellType.CalculatorButtonMappingCollection.Insert(System.Int32,System.Windows.Forms.Keys,System.String)">Insert(int, Keys, string)</h4>
<div class="markdown level1 summary"><p>Inserts a item to the <a class="xref" href="GrapeCity.Win.Spread.InputMan.CellType.CalculatorButtonMappingCollection.html">CalculatorButtonMappingCollection</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Insert(int index, Keys key, string buttonKey)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Insert(index As Integer, key As Keys, buttonKey As String)</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">index</span></td>
      <td><p>The index where the key is inserted.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.keys">Keys</a></td>
      <td><span class="parametername">key</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.keys">Keys</a> value indicates the key of  a button.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">buttonKey</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a> value indicates the name of the button.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>The <i>buttonKey</i> can't be <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a> or <b>string.Empty</b>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
      <td><p>The <i>buttonKey</i> isn't a correct Calculator Button Key, you can get all keys from <a class="xref" href="GrapeCity.Win.Spread.InputMan.CellType.DropDownCalculator.ButtonKeys.html#GrapeCity_Win_Spread_InputMan_CellType_DropDownCalculator_ButtonKeys">ButtonKeys</a> property.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
      <td><p>There is a same <i>key</i> had been added before, please change another one.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
