VGridControlBase.Print() Method
Prints the vertical grid control.
Namespace: DevExpress.XtraVerticalGrid
Assembly: DevExpress.XtraVerticalGrid.v24.2.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
#Declaration
#Remarks
The control’s data can be previewed and printed if the XtraPrinting Library is available. Use the VGridControlBase.IsPrintingAvailable property to check whether the control’s data can be printed.
To show a print preview, call VGridControlBase.ShowPrintPreview or VGridControlBase.ShowRibbonPrintPreview.
#Example
The following example demonstrates how to print a Vertical Grid or show its Print Preivew. To do this, you should use either the VGridControlBase.Print
or VGridControlBase.ShowPrintPreview methods.
Note
The Vertical Grid can be printed and previewed only if the Xtra
using DevExpress.XtraVerticalGrid;
// ...
private void ShowVerticalGridPreview(VGridControl vGrid) {
// Check whether the Vertical Grid can be previewed.
if (!vGrid.IsPrintingAvailable) {
MessageBox.Show("The 'DevExpress.XtraPrinting' library is not found", "Error");
return;
}
// Open the Preview window.
vGrid.ShowPrintPreview();
}
private void PrintVerticalGrid(VGridControl vGrid) {
// Check whether the Vertical Grid can be printed.
if (!vGrid.IsPrintingAvailable) {
MessageBox.Show("The 'DevExpress.XtraPrinting' library is not found", "Error");
return;
}
// Print.
vGrid.Print();
}