A newer version of this page is available. Switch to the current version.

How to: Preview XtraGrid Control

The following example shows how to preview XtraGrid.

private void ShowGridPreview(DevExpress.XtraGrid.GridControl grid) {
   // Check whether the Grid Control can be previewed.
   if(!grid.IsPrintingAvailable) {
      MessageBox.Show("The 'DevExpress.XtraPrinting' Library is not found", "Error");
   // Opens the Preview window.

The image below shows a Preview window for a sample grid.