DataGridLink Class
A link to print the DataGrid control.
Namespace: DevExpress.XtraPrintingLinks
Assembly: DevExpress.XtraPrinting.v24.1.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.Printing
Declaration
Remarks
Use the DataGridLink class to print the DataGrid control.
To do this, assign an existing DataGrid object to the DataGridLinkBase.DataGrid property, and then call either the DataGridLink.ShowPreview (DataGridLink.ShowPreviewDialog) method to preview a document, or the DataGridLink.Print (DataGridLink.PrintDlg) method to send it to a printer.
Example
This example demonstrates how to create and display a Print Preview for the DataGrid control, via the DataGridLink
.
using System;
using System.Windows.Forms;
using DevExpress.XtraPrintingLinks;
// ...
private void simpleButton1_Click(object sender, EventArgs e) {
DataGridLink dgLink = new DataGridLink();
dgLink.DataGrid = dataGrid1;
printingSystem1.Links.Add(dgLink);
dgLink.ShowPreviewDialog();
}
Inheritance
See Also