Articles in this section
Category / Section

What are all the printing options available in the WinForms GridControl, GridGroupingControl and GridDataBoundGrid?

2 mins read

Printing

The Essential grid provides support to print column headers, row headers, horizontal and vertical lines through corresponding properties used in the control.

GridControl

Printing Column and Row Headers

In order to print the column header and row header, the PrintColumnHeader and PrintRowHeader property can be used respectively.

C#

//To print with Column Header
this.gridControl1.PrintColumnHeader = true;
 
//To print with Row Header
this.gridControl1.PrintRowHeader = true;

VB

'To print with Column Header
Me.gridControl1.PrintColumnHeader = True
 
'To print with Row Header
Me.gridControl1.PrintRowHeader = True

Printing Horizontal and Vertical Lines

In order to print the horizontal and vertical lines of the grid, the PrintHorizontalLines and PrintVerticalLines property can be used.

C#

//To print Horizontal Lines
this.gridControl1.PrintHorizontalLines = true;
 
//To print Vertical Lines
this.gridControl1.PrintVerticalLines = true;

VB

'To print Horizontal Lines
Me.gridControl1.PrintHorizontalLines = True
 
'To print Vertical Lines
Me.gridControl1.PrintVerticalLines = True

GridGroupingControl

Printing Column and Row Headers

In order to print the column header and row header, the PrintColumnHeader and PrintRowHeader property can be used respectively.

C#

//To print with column headers
this.gridGroupingControl1.PrintColumnHeader = true;
 
//To print with row headers
this.gridGroupingControl1.PrintRowHeader = true;

VB

'To print with column headers
Me.gridGroupingControl1.PrintColumnHeader = True
 
'To print with row headers
Me.gridGroupingControl1.PrintRowHeader = True

Printing Horizontal and Vertical Lines

In order to print the horizontal and vertical lines of the grid, the PrintHorizontalLines and PrintVerticalLines property can be used.

C#

//To print horizontal lines
this.gridGroupingControl1.PrintHorizontalLines = true;
 
//To print vertical lines
this.gridGroupingControl1.PrintVerticalLines = true;

VB

'To print horizontal lines
Me.gridGroupingControl1.PrintHorizontalLines = True
 
'To print vertical lines
Me.gridGroupingControl1.PrintVerticalLines = True

 

Show the print preview dialog window

GridDataBoundGrid

Printing Column and Row Headers

In order to print the column header and row header, the PrintColumnHeader and PrintRowHeader property can be used respectively.

C#

//To print with column headers
this.gridDataBoundGrid1.PrintColumnHeader = true;
 
//To print with row headers
this.gridDataBoundGrid1.PrintRowHeader = true;

VB

'To print with column headers
Me.gridDataBoundGrid1.PrintColumnHeader = True
 
'To print with row headers
Me.gridDataBoundGrid1.PrintRowHeader = True

Printing Horizontal and Vertical Lines

In order to print the horizontal and vertical lines of the grid, the PrintHorizontalLines and PrintVerticalLines property can be used.

C#

//To print horizontal lines
this.gridDataBoundGrid1.PrintHorizontalLines = true;
 
//To print vertical lines
this.gridDataBoundGrid1.PrintVerticalLines = true;

VB 

'To print horizontal lines
Me.gridDataBoundGrid1.PrintHorizontalLines = True
 
'To print vertical lines
Me.gridDataBoundGrid1.PrintVerticalLines = True

 

Show the print preview dialog

Samples:

C#: PrintingOptions_CS

VB: PrintingOptions_VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment