# GrapeCity.Documents.Excel.ICustomXmlPart

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="GrapeCity_Documents_Excel_ICustomXmlPart" data-uid="GrapeCity.Documents.Excel.ICustomXmlPart" class="text-break">ICustomXmlPart Interface
</h1>
  <div class="markdown level0 summary"><p>Represents a Custom XML part in a workbook.</p>
<p>
A Custom XML part stores an arbitrary XML payload as raw bytes in the workbook package.
The part is identified by a generated ID that is persisted with the workbook and can be used
to retrieve the part after reopening the file.
</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.Documents.Excel.html">GrapeCity.Documents.Excel</a></h6>
  <h6><strong>Assembly</strong>: DS.Documents.Excel.dll</h6>
  <h5 id="GrapeCity_Documents_Excel_ICustomXmlPart_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public interface ICustomXmlPart</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Interface ICustomXmlPart</code></pre>
  </div>
  <h5 id="GrapeCity_Documents_Excel_ICustomXmlPart_examples"><strong>Examples</strong></h5>
  <pre><code class="lang-csharp">ICustomXmlPart customXmlPart = workbook.CustomXmlParts.Add();
customXmlPart.Data = System.Text.Encoding.UTF8.GetBytes("&lt;order&gt;&lt;id&gt;1001&lt;/id&gt;&lt;/order&gt;");

string id = customXmlPart.Id;
byte[] xmlData = customXmlPart.Data;</code></pre>

  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_Documents_Excel_ICustomXmlPart_Data" data-uid="GrapeCity.Documents.Excel.ICustomXmlPart.Data">
          <a class="xref" href="GrapeCity.Documents.Excel.ICustomXmlPart.Data.html#GrapeCity_Documents_Excel_ICustomXmlPart_Data">Data</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the raw data stored in the Custom XML part.</p>
<p>
The returned byte array is a copy of the stored data. Modifying the returned array does not
change the content of the Custom XML part. To update the part content, assign this property.
The provided byte array is copied into the Custom XML part and persisted as the XML payload
when the workbook is saved to an OpenXML workbook format.
</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Excel_ICustomXmlPart_Id" data-uid="GrapeCity.Documents.Excel.ICustomXmlPart.Id">
          <a class="xref" href="GrapeCity.Documents.Excel.ICustomXmlPart.Id.html#GrapeCity_Documents_Excel_ICustomXmlPart_Id">Id</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the unique ID of the Custom XML part.</p>
<p>
The ID is generated when the part is added to the workbook and is stored in the Custom XML part properties.
Use this value with <a class="xref" href="GrapeCity.Documents.Excel.ICustomXmlPartCollection.Item.html#GrapeCity_Documents_Excel_ICustomXmlPartCollection_Item_System_String_">this[string]</a> to retrieve the same part after
the workbook is saved and reopened.
</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
