Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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");
      return;
   }
   // Opens the Preview window.
   grid.ShowPreview();
}

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

CD_XtraGridPrinting