# C1.Win.FlexGrid.C1FlexGridBase.PrintGrid

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_C1FlexGridBase_PrintGrid_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.PrintGrid*">PrintGrid Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_C1FlexGridBase_PrintGrid_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.PrintGrid*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_PrintGrid_System_String_C1_Win_FlexGrid_PrintGridFlags_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.PrintGrid(System.String,C1.Win.FlexGrid.PrintGridFlags)">PrintGrid(string, PrintGridFlags)</h4>
<div class="markdown level1 summary"><p>Prints the grid, optionally showing a page setup or print preview dialog.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool PrintGrid(string docName, PrintGridFlags flags)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function PrintGrid(docName As String, flags As PrintGridFlags) As Boolean</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="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">docName</span></td>
      <td><p>The document name, which appears on the progress dialogs and on the print job windows.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Win.FlexGrid.PrintGridFlags.html">PrintGridFlags</a></td>
      <td><span class="parametername">flags</span></td>
      <td><p>Flags that select printing options.</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="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>True if the grid was printed, false if the user canceled the operation before printing started.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_PrintGrid_System_String_C1_Win_FlexGrid_PrintGridFlags__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Use the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.PrintParameters.html#C1_Win_FlexGrid_C1FlexGridBase_PrintParameters">PrintParameters</a> property to set up options such as page orientation 
and margins, header and footer fonts, etc.</p>
<p>The method returns true if the user started the printing process. If the user clicks cancel while 
the grid is printing, the method returns true (some pages may be printed anyway depending on the 
printer settings). To detect canceled jobs, handle the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.EndPrint.html">EndPrint</a> event and check the 
value of the e.Cancel parameter.</p>
</div>


<a id="C1_Win_FlexGrid_C1FlexGridBase_PrintGrid_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.PrintGrid*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_PrintGrid_System_String_C1_Win_FlexGrid_PrintGridFlags_System_String_System_String_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.PrintGrid(System.String,C1.Win.FlexGrid.PrintGridFlags,System.String,System.String)">PrintGrid(string, PrintGridFlags, string, string)</h4>
<div class="markdown level1 summary"><p>Prints the grid, optionally showing a page setup or print preview dialog.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool PrintGrid(string docName, PrintGridFlags flags, string header, string footer)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function PrintGrid(docName As String, flags As PrintGridFlags, header As String, footer As String) As Boolean</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="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">docName</span></td>
      <td><p>The document name, which appears on the progress dialogs and on the print job windows.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Win.FlexGrid.PrintGridFlags.html">PrintGridFlags</a></td>
      <td><span class="parametername">flags</span></td>
      <td><p>Flags that select printing options.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">header</span></td>
      <td><p>String that appears on the top of every page.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">footer</span></td>
      <td><p>String that appears on the bottom of every page.</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="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>True if the grid was printed, false if the user canceled the operation.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_PrintGrid_System_String_C1_Win_FlexGrid_PrintGridFlags_System_String_System_String__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The header and footer strings may contain up to three tab-delimited sections, which are 
aligned to the left, center, and right of the page. The strings may also contain placeholders 
that are replaced with the current page number and total number of pages ("{0}" and "{1}").</p>
<p>Use the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.PrintParameters.html#C1_Win_FlexGrid_C1FlexGridBase_PrintParameters">PrintParameters</a> property to set up options such as page orientation 
and margins, header and footer fonts, etc.</p>
</div>


<a id="C1_Win_FlexGrid_C1FlexGridBase_PrintGrid_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.PrintGrid*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_PrintGrid_System_String_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.PrintGrid(System.String)">PrintGrid(string)</h4>
<div class="markdown level1 summary"><p>Prints the grid, optionally showing a page setup or print preview dialog.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool PrintGrid(string docName)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function PrintGrid(docName As String) As Boolean</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="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">docName</span></td>
      <td><p>The document name, which appears on the progress dialogs and on the print job windows.</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="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>True if the grid was printed, false if the user canceled the operation.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_PrintGrid_System_String__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Use the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.PrintParameters.html#C1_Win_FlexGrid_C1FlexGridBase_PrintParameters">PrintParameters</a> property to set up options such as page orientation
and margins, header and footer fonts, etc.</p>
</div>
</div>
