# C1.Win.FlexGrid.C1FlexGridBase.Subtotal

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal*">Subtotal Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_Int32_System_Int32_System_Int32_System_String_C1_Win_FlexGrid_AggregateFlags_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal(C1.Win.FlexGrid.AggregateEnum,System.Int32,System.Int32,System.Int32,System.Int32,System.String,C1.Win.FlexGrid.AggregateFlags)">Subtotal(AggregateEnum, int, int, int, int, string, AggregateFlags)</h4>
<div class="markdown level1 summary"><p>Groups rows based on cell contents and calculates aggregate values.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Subtotal(AggregateEnum aggType, int level, int groupFrom, int groupTo, int totalOn, string caption, AggregateFlags options)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Subtotal(aggType As AggregateEnum, level As Integer, groupFrom As Integer, groupTo As Integer, totalOn As Integer, caption As String, options As AggregateFlags)</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="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a></td>
      <td><span class="parametername">aggType</span></td>
      <td><p><a class="xref" href="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a> value that specifies the type of aggregate to calculate.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">level</span></td>
      <td><p>Outline level to assign to the new subtotal rows. This parameter allows the creation of multi-level subtotals and affects the display of the outline tree.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">groupFrom</span></td>
      <td><p>First column in the range used to detect group breaks.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">groupTo</span></td>
      <td><p>Last column in the range used to detect group breaks.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">totalOn</span></td>
      <td><p>Column that contains values to be aggregated (usually numeric).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">caption</span></td>
      <td><p>Text to insert in the subtotal rows.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Win.FlexGrid.AggregateFlags.html">AggregateFlags</a></td>
      <td><span class="parametername">options</span></td>
      <td><p>Options to use when calculating the aggregates.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_Int32_System_Int32_System_Int32_System_String_C1_Win_FlexGrid_AggregateFlags__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The <span class="xref">C1.Win.FlexGrid.C1FlexGridBase.Subtotal(C1.Win.FlexGrid.AggregateEnum,System.Int32,System.Int32,System.Int32,System.Int32,System.String,C1.Win.FlexGrid.AggregateFlags,C1.Win.FlexGrid.RowColFlags)</span> method inserts rows containing aggregate values. These new rows are set 
to behave as tree nodes so they can be collapsed and expanded to display a dynamic hierarchical 
outline.</p>
<p>You can control the appearance and behavior of the outline tree using the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.Tree.html#C1_Win_FlexGrid_C1FlexGridBase_Tree">Tree</a> property.</p>
<p>The node rows added by the <span class="xref">C1.Win.FlexGrid.C1FlexGridBase.Subtotal(C1.Win.FlexGrid.AggregateEnum,System.Int32,System.Int32,System.Int32,System.Int32,System.String,C1.Win.FlexGrid.AggregateFlags,C1.Win.FlexGrid.RowColFlags)</span> method have their <a class="xref" href="C1.Win.FlexGrid.RowCol.Style.html#C1_Win_FlexGrid_RowCol_Style">Style</a> property 
automatically set to one of the Styles.Subtotal* styles. You can use the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.Styles.html#C1_Win_FlexGrid_C1FlexGridBase_Styles">Styles</a> 
collection to modify the appearance of all subtotal rows on the grid.</p>
<p>To create an outline tree manually, insert node rows using the <a class="xref" href="C1.Win.FlexGrid.RowCollection.InsertNode.html#C1_Win_FlexGrid_RowCollection_InsertNode_System_Int32_System_Int32_">InsertNode(int, int)</a> method, 
or convert regular rows into nodes by setting the <a class="xref" href="C1.Win.FlexGrid.Row.IsNode.html#C1_Win_FlexGrid_Row_IsNode">IsNode</a> property to true for the 
node rows. Then use the <a class="xref" href="C1.Win.FlexGrid.Node.Level.html#C1_Win_FlexGrid_Node_Level">Level</a> property to set the outline level for the new 
nodes.</p>
</div>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_Int32_System_Int32_System_Int32_System_String_C1_Win_FlexGrid_AggregateFlags__examples">Examples</h5>
<p>The code below assumes a grid with four columns: "Product", "Region", "Employee", and "Sales".</p>
<p>The code groups on the first two columns, calculating total sales for each product and for 
each region within each product.</p>
<p>If the user drags a column to a new position, the tree is automatically rebuilt to show 
the new grouping (by Employee, Region, etc).</p>
<pre><code class="lang-csharp">void UpdateTotals()
{
  // no repainting until we're done
  _flex.Redraw = false;

  // clear old subtotals, if any
  _flex.Subtotal(AggregateEnum.Clear);

  // sort the grid on the columns that will be grouped
  _flex.Sort(SortFlags.Ascending, 0, 3);

  // show outline tree on column 0
  _flex.Tree.Column = 0;

  // get a grand total (use -1 instead of column index)
  _flex.Subtotal(AggregateEnum.Sum, -1, -1, 3, "Grand Total");

  // total on column 0 (initially Product)
  _flex.Subtotal(AggregateEnum.Sum, 0, 0, 3);

  // total on column 1 (initially Region)
  _flex.Subtotal(AggregateEnum.Sum, 1, 1, 3);

  // show outline level 1
  _flex.Tree.Show(1);

  // restore painting
  _flex.Redraw = true;
}
void _flex_AfterDragColumn(object sender, DragRowColEventArgs e)        
{
  UpdateTotals(); // user moved a column, update totals
}</code></pre>



<a id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_Int32_System_Int32_System_Int32_System_String_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal(C1.Win.FlexGrid.AggregateEnum,System.Int32,System.Int32,System.Int32,System.Int32,System.String)">Subtotal(AggregateEnum, int, int, int, int, string)</h4>
<div class="markdown level1 summary"><p>Groups rows based on cell contents and calculates aggregate values.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Subtotal(AggregateEnum aggType, int level, int groupFrom, int groupTo, int totalOn, string caption)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Subtotal(aggType As AggregateEnum, level As Integer, groupFrom As Integer, groupTo As Integer, totalOn As Integer, caption As String)</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="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a></td>
      <td><span class="parametername">aggType</span></td>
      <td><p><a class="xref" href="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a> value that specifies the type of aggregate to calculate.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">level</span></td>
      <td><p>Outline level to assign to the new subtotal rows. This parameter allows the creation of multi-level subtotals and affects the display of the outline tree.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">groupFrom</span></td>
      <td><p>First column in the range used to detect group breaks.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">groupTo</span></td>
      <td><p>Last column in the range used to detect group breaks.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">totalOn</span></td>
      <td><p>Column that contains values to be aggregated (usually numeric).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">caption</span></td>
      <td><p>Text to insert in the subtotal rows.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_Int32_System_Int32_System_String_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal(C1.Win.FlexGrid.AggregateEnum,System.Int32,System.Int32,System.Int32,System.String)">Subtotal(AggregateEnum, int, int, int, string)</h4>
<div class="markdown level1 summary"><p>Groups rows based on cell contents and calculates aggregate values.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Subtotal(AggregateEnum aggType, int level, int groupOn, int totalOn, string caption)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Subtotal(aggType As AggregateEnum, level As Integer, groupOn As Integer, totalOn As Integer, caption As String)</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="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a></td>
      <td><span class="parametername">aggType</span></td>
      <td><p><a class="xref" href="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a> value that specifies the type of aggregate to calculate.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">level</span></td>
      <td><p>Outline level to assign to the new subtotal rows. This parameter allows the creation of multi-level subtotals and affects the display of the outline tree.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">groupOn</span></td>
      <td><p>Column used to detect group breaks.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">totalOn</span></td>
      <td><p>Column that contains values to be aggregated (usually numeric).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">caption</span></td>
      <td><p>Text to insert in the subtotal rows.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_Int32_System_Int32_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal(C1.Win.FlexGrid.AggregateEnum,System.Int32,System.Int32,System.Int32)">Subtotal(AggregateEnum, int, int, int)</h4>
<div class="markdown level1 summary"><p>Groups rows based on cell contents and calculates aggregate values.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Subtotal(AggregateEnum aggType, int level, int groupOn, int totalOn)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Subtotal(aggType As AggregateEnum, level As Integer, groupOn As Integer, totalOn As Integer)</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="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a></td>
      <td><span class="parametername">aggType</span></td>
      <td><p><a class="xref" href="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a> value that specifies the type of aggregate to calculate.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">level</span></td>
      <td><p>Outline level to assign to the new subtotal rows. This parameter allows the creation of multi-level subtotals and affects the display of the outline tree.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">groupOn</span></td>
      <td><p>Column used to detect group breaks.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">totalOn</span></td>
      <td><p>Column that contains values to be aggregated (usually numeric).</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal(C1.Win.FlexGrid.AggregateEnum)">Subtotal(AggregateEnum)</h4>
<div class="markdown level1 summary"><p>Groups rows based on cell contents and calculates aggregate values.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Subtotal(AggregateEnum aggType)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Subtotal(aggType As AggregateEnum)</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="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a></td>
      <td><span class="parametername">aggType</span></td>
      <td><p><a class="xref" href="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a> value that specifies the type of aggregate to calculate.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This version of the <span class="xref">C1.Win.FlexGrid.C1FlexGridBase.Subtotal(C1.Win.FlexGrid.AggregateEnum,System.Int32,System.Int32,System.Int32,System.Int32,System.String,C1.Win.FlexGrid.AggregateFlags,C1.Win.FlexGrid.RowColFlags)</span> method does not take any column parameters,
and is useful only for clearing the subtotals. For example:</p>
<pre><code class="lang-csharp">flex.Subtotal(AggregateEnum.Clear); // clear all subtotals</code></pre>
</div>


<a id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_String_System_String_System_String_System_String_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal(C1.Win.FlexGrid.AggregateEnum,System.Int32,System.String,System.String,System.String,System.String)">Subtotal(AggregateEnum, int, string, string, string, string)</h4>
<div class="markdown level1 summary"><p>Groups rows based on cell contents and calculates aggregate values.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Subtotal(AggregateEnum aggType, int level, string groupFrom, string groupTo, string totalOn, string caption)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Subtotal(aggType As AggregateEnum, level As Integer, groupFrom As String, groupTo As String, totalOn As String, caption As String)</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="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a></td>
      <td><span class="parametername">aggType</span></td>
      <td><p><a class="xref" href="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a> value that specifies the type of aggregate to calculate.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">level</span></td>
      <td><p>Outline level to assign to the new subtotal rows. This parameter allows the creation of multi-level subtotals and affects the display of the outline tree.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">groupFrom</span></td>
      <td><p>Name of the first column in the range used to detect group breaks.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">groupTo</span></td>
      <td><p>Name of the last column in the range used to detect group breaks.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">totalOn</span></td>
      <td><p>Name of the column that contains values to be aggregated (usually numeric).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">caption</span></td>
      <td><p>Text to insert in the subtotal rows.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_String_System_String_System_String_System_String__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This is a variant of the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.Subtotal.html#C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_Int32_System_Int32_System_Int32_System_String_C1_Win_FlexGrid_AggregateFlags_">Subtotal(AggregateEnum, int, int, int, int, string, AggregateFlags)</a> method
that takes column names instead of indices.</p>
</div>


<a id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_String_System_String_System_String_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal(C1.Win.FlexGrid.AggregateEnum,System.Int32,System.String,System.String,System.String)">Subtotal(AggregateEnum, int, string, string, string)</h4>
<div class="markdown level1 summary"><p>Groups rows based on cell contents and calculates aggregate values.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Subtotal(AggregateEnum aggType, int level, string groupOn, string totalOn, string caption)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Subtotal(aggType As AggregateEnum, level As Integer, groupOn As String, totalOn As String, caption As String)</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="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a></td>
      <td><span class="parametername">aggType</span></td>
      <td><p><a class="xref" href="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a> value that specifies the type of aggregate to calculate.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">level</span></td>
      <td><p>Outline level to assign to the new subtotal rows. This parameter allows the creation of multi-level subtotals and affects the display of the outline tree.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">groupOn</span></td>
      <td><p>Name column used to detect group breaks.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">totalOn</span></td>
      <td><p>Name of the column that contains values to be aggregated (usually numeric).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">caption</span></td>
      <td><p>Text to insert in the subtotal rows.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_String_System_String_System_String__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This is a variant of the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.Subtotal.html#C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_Int32_System_Int32_System_String_">Subtotal(AggregateEnum, int, int, int, string)</a> method
that takes column names instead of indices.</p>
</div>


<a id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_String_System_String_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.Subtotal(C1.Win.FlexGrid.AggregateEnum,System.Int32,System.String,System.String)">Subtotal(AggregateEnum, int, string, string)</h4>
<div class="markdown level1 summary"><p>Groups rows based on cell contents and calculates aggregate values.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Subtotal(AggregateEnum aggType, int level, string groupOn, string totalOn)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Subtotal(aggType As AggregateEnum, level As Integer, groupOn As String, totalOn As String)</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="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a></td>
      <td><span class="parametername">aggType</span></td>
      <td><p><a class="xref" href="C1.Win.FlexGrid.AggregateEnum.html">AggregateEnum</a> value that specifies the type of aggregate to calculate.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">level</span></td>
      <td><p>Outline level to assign to the new subtotal rows. This parameter allows the creation of multi-level subtotals and affects the display of the outline tree.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">groupOn</span></td>
      <td><p>Name column used to detect group breaks.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">totalOn</span></td>
      <td><p>Name of the column that contains values to be aggregated (usually numeric).</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_String_System_String__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This is a variant of the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.Subtotal.html#C1_Win_FlexGrid_C1FlexGridBase_Subtotal_C1_Win_FlexGrid_AggregateEnum_System_Int32_System_Int32_System_Int32_">Subtotal(AggregateEnum, int, int, int)</a> method
that takes column names instead of indices.</p>
</div>
</div>
