List lets you print the list and perform various basic and advanced print settings using its built-in methods and properties. Let us explore how to use these methods and properties to print the List.
You can use Print method of the PrintInfo class to print the entire list and its content. This method has an optional parameter, printerSettings that allows you to specify the printer settings.
The following code demonstrates how to print the list and its content.
C# |
Copy Code
|
---|---|
//print the list
c1List1.PrintInfo.Print();
|
The PrintInfo class provides various options to print the list. It lets you set many advanced printing options such as header and footer fonts, page margins, page orientation, and much more.
Use the following code to print the List using advanced print options. The following code example sets the page footer, footer height, and bottom margin.
C# |
Copy Code
|
---|---|
c1List1.PrintInfo.PageFooter = "All Rights Reserved";
c1List1.PrintInfo.PageFooterHeight = 10;
c1List1.PrintInfo.PageSettings.Margins.Bottom = 15;
|