# GrapeCity.Documents.Excel.IPivotField.DragToRow

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Excel_IPivotField_DragToRow_" data-uid="GrapeCity.Documents.Excel.IPivotField.DragToRow*">DragToRow Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Excel_IPivotField_DragToRow_" data-uid="GrapeCity.Documents.Excel.IPivotField.DragToRow*"></a>
<h4 id="GrapeCity_Documents_Excel_IPivotField_DragToRow" data-uid="GrapeCity.Documents.Excel.IPivotField.DragToRow">DragToRow</h4>
<div class="markdown level1 summary"><p>Gets or sets whether the field can be dragged to the row position.</p>
<p>
This property determines whether the field is allowed to be moved to the row area
in a PivotTable. The default value is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>.
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">bool DragToRow { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Property DragToRow As Boolean</code></pre>
</div>
<h5 id="GrapeCity_Documents_Excel_IPivotField_DragToRow_examples">Examples</h5>
<pre><code class="lang-csharp">worksheet.Range["A1:C4"].Value = new object[,] {
    {"Region", "Product", "Amount"},
    {"East", "Apple", 100},
    {"West", "Pear", 200},
    {"East", "Pear", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "SalesPivot");
IPivotField field = pivotTable.PivotFields["Region"];
bool canDragToRow = field.DragToRow;</code></pre>

</div>
