文檔首頁(yè)>>DevExpress WinForm中文手冊(cè)>>如何預(yù)覽XtraGrid控件
如何預(yù)覽XtraGrid控件
下面的示例展示了如何預(yù)覽XtraGrid。
C#:
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(); }
VB.NET:
Sub ShowGridPreview(ByVal grid As DevExpress.XtraGrid.GridControl) ' Check whether the Grid Control can be previewed. If Not grid.IsPrintingAvailable Then MessageBox.Show("The 'DevExpress.XtraPrinting' Library is not found", "Error") Return End If ' Opens the Preview window. grid.ShowPreview() End Sub
下圖顯示了一個(gè)示例網(wǎng)格的預(yù)覽窗口。