# GrapeCity.Documents.Excel.PivotFieldCustomGroupOptions

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="GrapeCity_Documents_Excel_PivotFieldCustomGroupOptions" data-uid="GrapeCity.Documents.Excel.PivotFieldCustomGroupOptions" class="text-break">PivotFieldCustomGroupOptions Class
</h1>
  <div class="markdown level0 summary"><p>Represents the settings used to create a custom group from PivotItems in a PivotField.</p>
<p>
Use this class to configure the item names, optional group name, and whether generated
group fields are automatically added to the PivotTable layout by
<a class="xref" href="GrapeCity.Documents.Excel.IPivotField.Group.html#GrapeCity_Documents_Excel_IPivotField_Group_GrapeCity_Documents_Excel_PivotFieldCustomGroupOptions_">Group(PivotFieldCustomGroupOptions)</a>.
</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">PivotFieldCustomGroupOptions</span></div>
  </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_PivotFieldCustomGroupOptions_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class PivotFieldCustomGroupOptions</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class PivotFieldCustomGroupOptions</code></pre>
  </div>
  <h5 id="GrapeCity_Documents_Excel_PivotFieldCustomGroupOptions_examples"><strong>Examples</strong></h5>
  <pre><code class="lang-csharp">PivotFieldCustomGroupOptions options = new PivotFieldCustomGroupOptions
{
    Name = "Fruit Group",
    Items = new List&lt;string&gt; { "Apple", "Banana" }
};
productField.Group(options);</code></pre>

  <h3 id="constructors">Constructors
</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_PivotFieldCustomGroupOptions__ctor" data-uid="GrapeCity.Documents.Excel.PivotFieldCustomGroupOptions.#ctor">
          <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldCustomGroupOptions.-ctor.html#GrapeCity_Documents_Excel_PivotFieldCustomGroupOptions__ctor">PivotFieldCustomGroupOptions()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
    </tbody>
  </table>
  <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_PivotFieldCustomGroupOptions_AddGeneratedFieldsToLayout" data-uid="GrapeCity.Documents.Excel.PivotFieldCustomGroupOptions.AddGeneratedFieldsToLayout">
          <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldCustomGroupOptions.AddGeneratedFieldsToLayout.html#GrapeCity_Documents_Excel_PivotFieldCustomGroupOptions_AddGeneratedFieldsToLayout">AddGeneratedFieldsToLayout</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets whether generated group fields are automatically added to the PivotTable layout.</p>
<p>
The default value is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>.
</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Excel_PivotFieldCustomGroupOptions_Items" data-uid="GrapeCity.Documents.Excel.PivotFieldCustomGroupOptions.Items">
          <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldCustomGroupOptions.Items.html#GrapeCity_Documents_Excel_PivotFieldCustomGroupOptions_Items">Items</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the source PivotItem names to include in the new custom group.</p>
<p>
The list must contain at least one item name when grouping is applied.
Source names, item names, and captions are matched without case sensitivity.
Set this property to <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a> to clear the item list.
</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Excel_PivotFieldCustomGroupOptions_Name" data-uid="GrapeCity.Documents.Excel.PivotFieldCustomGroupOptions.Name">
          <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldCustomGroupOptions.Name.html#GrapeCity_Documents_Excel_PivotFieldCustomGroupOptions_Name">Name</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the display name of the created custom group.</p>
<p>
If this value is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a> or empty, a default group name is used when grouping is applied.
If the specified name already exists, grouping fails.
</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
