# GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.UpdatePivotField

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_Commands_PivotTables_PivotTableCommand_UpdatePivotField_" data-uid="GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.UpdatePivotField*">UpdatePivotField Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_Commands_PivotTables_PivotTableCommand_UpdatePivotField_" data-uid="GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.UpdatePivotField*"></a>
<h4 id="GrapeCity_Spreadsheet_Commands_PivotTables_PivotTableCommand_UpdatePivotField_GrapeCity_Spreadsheet_PivotTables_IPivotTable_GrapeCity_Spreadsheet_PivotTables_IPivotField_System_Nullable_GrapeCity_Spreadsheet_PivotTables_PivotFieldOrientation__System_Nullable_System_Boolean__System_Nullable_GrapeCity_Spreadsheet_PivotTables_ConsolidationFunction__System_Nullable_GrapeCity_Spreadsheet_PivotTables_ConsolidationFunction__System_Nullable_GrapeCity_Spreadsheet_PivotTables_PivotFieldCalculation__System_Nullable_System_Boolean__" data-uid="GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.UpdatePivotField(GrapeCity.Spreadsheet.PivotTables.IPivotTable,GrapeCity.Spreadsheet.PivotTables.IPivotField,System.Nullable{GrapeCity.Spreadsheet.PivotTables.PivotFieldOrientation},System.Nullable{System.Boolean},System.Nullable{GrapeCity.Spreadsheet.PivotTables.ConsolidationFunction},System.Nullable{GrapeCity.Spreadsheet.PivotTables.ConsolidationFunction},System.Nullable{GrapeCity.Spreadsheet.PivotTables.PivotFieldCalculation},System.Nullable{System.Boolean})">UpdatePivotField(IPivotTable, IPivotField, PivotFieldOrientation?, bool?, ConsolidationFunction?, ConsolidationFunction?, PivotFieldCalculation?, bool?)</h4>
<div class="markdown level1 summary"><p>Initializes a new command to update the <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotField.html">IPivotField</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Command UpdatePivotField(IPivotTable pivotTable, IPivotField pivotField, PivotFieldOrientation? orientation = null, bool? keepOnlySelectedItems = null, ConsolidationFunction? subtotals = null, ConsolidationFunction? function = null, PivotFieldCalculation? calculation = null, bool? removeGrandTotals = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function UpdatePivotField(pivotTable As IPivotTable, pivotField As IPivotField, Optional orientation As PivotFieldOrientation? = Nothing, Optional keepOnlySelectedItems As Boolean? = Nothing, Optional subtotals As ConsolidationFunction? = Nothing, Optional [function] As ConsolidationFunction? = Nothing, Optional calculation As PivotFieldCalculation? = Nothing, Optional removeGrandTotals As Boolean? = Nothing) As Command</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="GrapeCity.Spreadsheet.PivotTables.IPivotTable.html">IPivotTable</a></td>
      <td><span class="parametername">pivotTable</span></td>
      <td><p>The <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotTable.html">IPivotTable</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotField.html">IPivotField</a></td>
      <td><span class="parametername">pivotField</span></td>
      <td><p>The <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotField.html">IPivotField</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.PivotFieldOrientation.html">PivotFieldOrientation</a>?</td>
      <td><span class="parametername">orientation</span></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.PivotFieldOrientation.html">PivotFieldOrientation</a> value that represents the location of the field in the specified <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotTable.html">IPivotTable</a> report.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>?</td>
      <td><span class="parametername">keepOnlySelectedItems</span></td>
      <td><p>A boolean value that determines whether the <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotField.html">IPivotField</a> object is visible</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.ConsolidationFunction.html">ConsolidationFunction</a>?</td>
      <td><span class="parametername">subtotals</span></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.ConsolidationFunction.html">ConsolidationFunction</a> value indicates whether subtotals displayed with the specified <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotField.html">IPivotField</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.ConsolidationFunction.html">ConsolidationFunction</a>?</td>
      <td><span class="parametername">function</span></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.ConsolidationFunction.html">ConsolidationFunction</a> value indicates whether function is used for the specified <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotField.html">IPivotField</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.PivotFieldCalculation.html">PivotFieldCalculation</a>?</td>
      <td><span class="parametername">calculation</span></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.PivotFieldCalculation.html">PivotFieldCalculation</a> value indicates whether calculation is used for the specified <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotField.html">IPivotField</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>?</td>
      <td><span class="parametername">removeGrandTotals</span></td>
      <td><p>A boolean value indicates whether the <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotTable.html">IPivotTable</a> report hides grand totals for rows/columns.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.Commands.Command.html">Command</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
