Spread Silverlight Documentation
Centering Property
Example 


GrapeCity.Windows.SpreadSheet.Data Namespace > PrintInfo Class : Centering Property
Gets or sets how the printed page is centered.
Syntax
'Declaration
 
<System.ComponentModel.DefaultValueAttribute()>
Public Property Centering As Centering
'Usage
 
Dim instance As PrintInfo
Dim value As Centering
 
instance.Centering = value
 
value = instance.Centering
[System.ComponentModel.DefaultValue()]
public Centering Centering {get; set;}

Property Value

A value that specifies how to center the printed page. The default value is None.
Example
This example uses the Centering property.
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = "PDF File (.pdf)|*.pdf";
bool? useClick = saveFileDialog.ShowDialog();
if (useClick == true)
{
    var stream = saveFileDialog.OpenFile();

GrapeCity.Windows.SpreadSheet.Data.PrintInfo printset = new GrapeCity.Windows.SpreadSheet.Data.PrintInfo();
printset.BestFitRows = true;
printset.Centering = GrapeCity.Windows.SpreadSheet.Data.Centering.Both;
printset.ColumnEnd = 10;
printset.ColumnStart = 0;
gcSpreadSheet1.Sheets[0].PrintInfo = printset;
gcSpreadSheet1.SavePDF(stream, 0);

 stream.Dispose();
}
Dim saveFileDialog = New SaveFileDialog()
saveFileDialog.Filter = "PDF File(.pdf)|*.pdf"
Dim useClick As Boolean = saveFileDialog.ShowDialog()
If (useClick = True) Then
Dim stream = saveFileDialog.OpenFile()

Dim printset As New GrapeCity.Windows.SpreadSheet.Data.PrintInfo()
printset.BestFitRows = True
printset.Centering = GrapeCity.Windows.SpreadSheet.Data.Centering.Both
printset.ColumnEnd = 10
printset.ColumnStart = 0
GcSpreadSheet1.Sheets(0).PrintInfo = printset
GcSpreadSheet1.SavePDF(stream, 0)
See Also

Reference

PrintInfo Class
PrintInfo Members