# GrapeCity.Documents.Common.OwnedKeyedCollection-2.CheckKey

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Common_OwnedKeyedCollection_2_CheckKey_" data-uid="GrapeCity.Documents.Common.OwnedKeyedCollection`2.CheckKey*">CheckKey Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Common_OwnedKeyedCollection_2_CheckKey_" data-uid="GrapeCity.Documents.Common.OwnedKeyedCollection`2.CheckKey*"></a>
<h4 id="GrapeCity_Documents_Common_OwnedKeyedCollection_2_CheckKey__1__0__0_" data-uid="GrapeCity.Documents.Common.OwnedKeyedCollection`2.CheckKey(`1,`0,`0)">CheckKey(TItem, TKey, TKey)</h4>
<div class="markdown level1 summary"><p>Throws an exception if collection already contains item with specified key.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual void CheckKey(TItem item, TKey oldKey, TKey newKey)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Sub CheckKey(item As TItem, oldKey As TKey, newKey As TKey)</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">TItem</span></td>
      <td><span class="parametername">item</span></td>
      <td><p>The item to check.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">TKey</span></td>
      <td><span class="parametername">oldKey</span></td>
      <td><p>The old key.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">TKey</span></td>
      <td><span class="parametername">newKey</span></td>
      <td><p>The new key.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
