# GrapeCity.ActiveReports.Design.Designer.DestroyComponent

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_ActiveReports_Design_Designer_DestroyComponent_" data-uid="GrapeCity.ActiveReports.Design.Designer.DestroyComponent*">DestroyComponent Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_Design_Designer_DestroyComponent_" data-uid="GrapeCity.ActiveReports.Design.Designer.DestroyComponent*"></a>
<h4 id="GrapeCity_ActiveReports_Design_Designer_DestroyComponent_System_ComponentModel_IComponent_" data-uid="GrapeCity.ActiveReports.Design.Designer.DestroyComponent(System.ComponentModel.IComponent)">DestroyComponent(IComponent)</h4>
<div class="markdown level1 summary"><p>Removes a component from the designer's site. It is essential to call this method after a Section, Parameter, Control, or Field is removed from its collection
to ensure proper removal of its design-time component.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DestroyComponent(IComponent component)</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.componentmodel.icomponent">IComponent</a></td>
      <td><span class="parametername">component</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.icomponent">IComponent</a> to remove.</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.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>Thrown if the user attempts to remove the RootComponent, as it cannot be removed.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
