Class PrintManagerBase
Provides the base implementation for printing related operation in SfDataGrid.
Implements
Namespace: Syncfusion.UI.Xaml.Grid
Assembly: Syncfusion.SfGrid.UWP.dll
Syntax
public class PrintManagerBase : Object, INotifyPropertyChanged, IDisposable
Constructors
PrintManagerBase(ICollectionViewAdv)
Initializes a new instance of PrintManagerBase class.
Declaration
public PrintManagerBase(ICollectionViewAdv view)
Parameters
Type | Name | Description |
---|---|---|
ICollectionViewAdv | view | The corresponding view to print. |
Fields
printOrientation
Declaration
protected PrintOrientation printOrientation
Field Value
Type |
---|
Windows.Graphics.Printing.PrintOrientation |
Properties
AllowColumnWidthFitToPrintPage
Gets or sets a value that indicates whether equal width is set for all columns to fit in single page.
Declaration
protected bool AllowColumnWidthFitToPrintPage { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the column width is fit in single page; otherwise, false. |
AllowPrintStyles
Gets or sets a value that indicates whether the style included for printing.
Declaration
protected bool AllowPrintStyles { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the SfDataGrid is printed with style; otherwise, false. |
AllowRepeatHeaders
Gets or sets a value that indicates whether the column headers are repeated in each page .
Declaration
protected bool AllowRepeatHeaders { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the column header is repeated in each page; otherwise, false. |
CanPrintStackedHeaders
Gets or sets a value that indicates whether the stacked header included for printing.
Declaration
protected bool CanPrintStackedHeaders { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the SfDataGrid is printed with stacked header; otherwise, false. |
IndentColumnWidth
Gets or sets the width for indent columns while printing.
Declaration
protected double IndentColumnWidth { get; set; }
Property Value
Type |
---|
System.Double |
Remarks
You can set zero when you don't want to display indent columns while printing selected list of records.
IsCaptionSummaryInRow
Gets a value that determines whether the corresponding row is CaptionSummaryRow for printing.
Declaration
protected virtual bool IsCaptionSummaryInRow { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the row is CaptionSummaryRow; otherwise , false. |
PageDictionary
Gets or sets the page dictionary that holds the row information for each page.
Declaration
protected Dictionary<int, List<RowInfo>> PageDictionary { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Int32, System.Collections.Generic.List<RowInfo>> | The row info of each page. |
PrintDocument
Gets the Windows.UI.Xaml.Printing.PrintDocument to be printed.
Declaration
protected PrintDocument PrintDocument { get; }
Property Value
Type |
---|
Windows.UI.Xaml.Printing.PrintDocument |
PrintFlowDirection
Gets or sets a value that indicates the direction of page content for printing.
Declaration
public FlowDirection PrintFlowDirection { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Xaml.FlowDirection | One of the |
PrintHeaderRowHeight
Gets or sets the height of the header row for printing.
Declaration
public double PrintHeaderRowHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The preferred height of the header row. |
PrintPageFooterHeight
Gets or sets the height of page footer for printing.
Declaration
public double PrintPageFooterHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The preferred width of the page footer. |
PrintPageFooterTemplate
Gets or sets
Declaration
public DataTemplate PrintPageFooterTemplate { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Xaml.DataTemplate | The object that defines the visual representation of the page footer. The default is null. |
PrintPageHeaderHeight
Gets or sets the height of page header for printing.
Declaration
public double PrintPageHeaderHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The preferred width of the page header. |
PrintPageHeaderTemplate
Gets or sets
Declaration
public DataTemplate PrintPageHeaderTemplate { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Xaml.DataTemplate | The object that defines the visual representation of the page header. The default is null. |
PrintPageHeight
Gets or sets the height of page for printing.
Declaration
public double PrintPageHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The preferred height of the page. |
PrintPageMargin
Gets or sets the margin of page for printing.
Declaration
public Thickness PrintPageMargin { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Xaml.Thickness | Provides the margin value for the page. |
PrintPageOrientation
Gets or sets a value indicating how the page content is oriented for printing.
Declaration
public PrintOrientation PrintPageOrientation { get; set; }
Property Value
Type | Description |
---|---|
Windows.Graphics.Printing.PrintOrientation | One of the |
PrintPageWidth
Gets or sets the width of page for printing.
Declaration
public double PrintPageWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The preferred width of the page. |
PrintRowHeight
Gets or sets the height of the DataRow for printing.
Declaration
public double PrintRowHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The preferred height of the DataRow. |
PrintScaleOption
Gets or sets a value indicating how the page content is scaled for printing.
Declaration
public PrintScaleOptions PrintScaleOption { get; set; }
Property Value
Type | Description |
---|---|
PrintScaleOptions | One of the PrintScaleOptions enumeration that specifies how the page content is scaled. The default orientation is NoScaling. |
Provider
Gets or sets the reference to the IPropertyAccessProvider to retrieve the formatted cell value of corresponding column.
Declaration
protected IPropertyAccessProvider Provider { get; set; }
Property Value
Type | Description |
---|---|
IPropertyAccessProvider | The corresponding cell value of column. |
View
Gets the reference to the ICollectionViewAdv which manage the records, sorting, grouping, summaries and filtering in SfDataGrid.
Declaration
protected ICollectionViewAdv View { get; }
Property Value
Type |
---|
ICollectionViewAdv |
Methods
AddCaptionSummaryInfoToDict(Object, List<String>, Double, Int32, Int32)
Adds the caption summary information to dictionary that is going to be printed.
Declaration
protected virtual List<CellInfo> AddCaptionSummaryInfoToDict(object record, List<string> columnNames, double yPos, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | The corresponding record of caption summary information is added in to dictionary. |
System.Collections.Generic.List<System.String> | columnNames | The list of column names collection that is used to measures the number of column arranged in a page. |
System.Double | yPos | The y position of the page. |
System.Int32 | startColumnIndex | The start index of the column to add caption summary information for printing. |
System.Int32 | endColumnIndex | The end index of the column to add caption summary information for printing. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<CellInfo> | Returns the list of caption summary cell info that is going to be printed. |
AddCaptionSummaryRowToPanel(PrintPagePanel, RowInfo)
Adds the caption summary row to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddCaptionSummaryRowToPanel(PrintPagePanel panel, RowInfo rowInfo)
Parameters
Type | Name | Description |
---|---|---|
PrintPagePanel | panel | The corresponding panel to add the caption summary row for printing. |
RowInfo | rowInfo | The corresponding caption summary row information that is added to the panel for printing. |
AddDataRowToPanel(PrintPagePanel, RowInfo)
Adds the data row to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddDataRowToPanel(PrintPagePanel panel, RowInfo rowInfo)
Parameters
Type | Name | Description |
---|---|---|
PrintPagePanel | panel | The corresponding panel to add the data row for printing. |
RowInfo | rowInfo | The corresponding data row information that is added to the panel for printing. |
AddHeaderInfoToDict(List<String>, Double, Int32, Int32)
Adds the header information to dictionary that is going to be printed.
Declaration
protected virtual List<CellInfo> AddHeaderInfoToDict(List<string> columnsNames, double yPos, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.String> | columnsNames | The list of column names collection that is used to measures the number of header arranged in a page. |
System.Double | yPos | The y position of the page. |
System.Int32 | startColumnIndex | The start index of the column to add header information for printing. |
System.Int32 | endColumnIndex | The end index of the column to add header information for printing. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<CellInfo> | Returns the list of header cell info that is going to be printed. |
AddHeaderRowToPanel(PrintPagePanel, RowInfo)
Adds the header row to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddHeaderRowToPanel(PrintPagePanel panel, RowInfo rowInfo)
Parameters
Type | Name | Description |
---|---|---|
PrintPagePanel | panel | The corresponding panel to add the header row for printing. |
RowInfo | rowInfo | The corresponding header row information that is added to the panel for printing. |
AddParentRecordInfoToDict(List<RowInfo>, Object, List<String>, ref Double, Int32, Int32)
Adds the parent record information to dictionary that is going to be printed.
Declaration
protected bool AddParentRecordInfoToDict(List<RowInfo> rowDictionary, object record, List<string> columnNames, ref double yPos, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<RowInfo> | rowDictionary | The rowDictionary to add the parent record information in page for printing. |
System.Object | record | The corresponding record information of parent that is added in to dictionary. |
System.Collections.Generic.List<System.String> | columnNames | The list of column names collection that is used to measures the number of column arranged in a page. |
System.Double | yPos | The y position of the page. |
System.Int32 | startColumnIndex | The start index of the column to add the parent record information for printing. |
System.Int32 | endColumnIndex | The end index of the column to add the parent record information for printing. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the parent record information is added in page; otherwise, false. |
AddRecordInfoToDict(Object, List<String>, Double, Int32, Int32)
Adds the record information to dictionary that is going to be printed.
Declaration
protected virtual List<CellInfo> AddRecordInfoToDict(object record, List<string> columnNames, double yPos, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | The corresponding record information that is added in to dictionary for printing. |
System.Collections.Generic.List<System.String> | columnNames | The list of column names collection that is used to measures the number of column arranged in a page. |
System.Double | yPos | The y position of the page. |
System.Int32 | startColumnIndex | The start index of the column to add record information for printing. |
System.Int32 | endColumnIndex | The end index of the column to add record information for printing. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<CellInfo> | Returns the list of record cell info that is going to be printed. |
AddRowInformationToDictionary(Object, List<String>, Double, Int32, Int32)
Adds the row information to dictionary that is going to be printed.
Declaration
protected virtual List<CellInfo> AddRowInformationToDictionary(object record, List<string> columnNames, double yPos, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | The corresponding record information of row is added to dictionary. |
System.Collections.Generic.List<System.String> | columnNames | The list of column names collection that is used to measures the number of columns arranged in a page. |
System.Double | yPos | The y position of the page. |
System.Int32 | startColumnIndex | The start index of the column to add row information for printing. |
System.Int32 | endColumnIndex | The end index of the column to add row information for printing. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<CellInfo> | Returns the list of cell info that is going to be printed. |
Remarks
Invoked to add rows such as normal row, Unbound row, group caption summary row, summary row, table summary row to dictionary for printing.
AddRowToPrintPagePanel(PrintPagePanel, RowInfo, Int32)
Adds the row info to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddRowToPrintPagePanel(PrintPagePanel panel, RowInfo rowInfo, int pageIndex)
Parameters
Type | Name | Description |
---|---|---|
PrintPagePanel | panel | The corresponding panel to add the row that is to be printed. |
RowInfo | rowInfo | The corresponding row information that is added to panel. |
System.Int32 | pageIndex | The corresponding index of page to add the row to print page panel. |
Remarks
Invoked to add Rows such as Header row,summary(group summary, table summary),Unboundrow, etc... to PrintPagePanel.
AddStackedHeaderInfotoDict(Double, Int32, Int32, Int32)
Declaration
protected virtual List<CellInfo> AddStackedHeaderInfotoDict(double yPos, int startColumnIndex, int endColumnIndex, int start)
Parameters
Type | Name | Description |
---|---|---|
System.Double | yPos | |
System.Int32 | startColumnIndex | |
System.Int32 | endColumnIndex | |
System.Int32 | start |
Returns
Type |
---|
System.Collections.Generic.List<CellInfo> |
AddStackedHeaderRowToPanel(PrintPagePanel, RowInfo)
Adds the header row to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddStackedHeaderRowToPanel(PrintPagePanel panel, RowInfo rowinfo)
Parameters
Type | Name | Description |
---|---|---|
PrintPagePanel | panel | The corresponding panel to add the header row for printing. |
RowInfo | rowinfo |
AddSummaryInfoToDict(Object, List<String>, Double, Int32, Int32)
Adds the summary information to dictionary that is going to be printed.
Declaration
protected virtual List<CellInfo> AddSummaryInfoToDict(object record, List<string> columnNames, double yPos, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | The corresponding record of summary information is added in to dictionary. |
System.Collections.Generic.List<System.String> | columnNames | The list of column names collection that is used to measures the number of column arranged in a page. |
System.Double | yPos | The y position of the page. |
System.Int32 | startColumnIndex | The start index of the column to add summary information for printing. |
System.Int32 | endColumnIndex | The end index of the column to add summary information for printing. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<CellInfo> | Returns the list of summary cell info that is going to be printed. |
AddSummaryRowToPanel(PrintPagePanel, RowInfo)
Adds the summary row to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddSummaryRowToPanel(PrintPagePanel panel, RowInfo rowInfo)
Parameters
Type | Name | Description |
---|---|---|
PrintPagePanel | panel | The corresponding panel to add the summary row for printing. |
RowInfo | rowInfo | The corresponding summary row information that is added to the panel for printing. |
AddTableSummaryInfoToDict(Object, List<String>, Double, Int32, Int32)
Adds the table summary information to dictionary that is going to be printed.
Declaration
protected virtual List<CellInfo> AddTableSummaryInfoToDict(object record, List<string> columnNames, double yPos, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | The corresponding record of table summary information is added in to dictionary. |
System.Collections.Generic.List<System.String> | columnNames | The list of column names collection that is used to measures the number of column arranged in a page. |
System.Double | yPos | The y position of the page. |
System.Int32 | startColumnIndex | The start index of the column to add table summary information for printing. |
System.Int32 | endColumnIndex | The end index of the column to add table summary information for printing. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<CellInfo> | Returns the list of table summary cell info that is going to be printed. |
AddTableSummaryRowToPanel(PrintPagePanel, RowInfo)
Adds the table summary row to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddTableSummaryRowToPanel(PrintPagePanel panel, RowInfo rowInfo)
Parameters
Type | Name | Description |
---|---|---|
PrintPagePanel | panel | The corresponding panel to add the table summary row for printing. |
RowInfo | rowInfo | The corresponding table summary row information that is added to the panel for printing. |
ComputeColumnForPage(Int32, List<String>, Size, out Int32, out Int32)
Calculates the list of specified column names can be arranged in a particular page index with in the available size of page.
Declaration
protected virtual void ComputeColumnForPage(int pageIndex, List<string> columnNames, Size avaliableSize, out int startColumnIndex, out int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageIndex | The corresponding page index to arrange the number of column with in the page. |
System.Collections.Generic.List<System.String> | columnNames | The list of column names collection to arrange the column with in the specified page index. |
Windows.Foundation.Size | avaliableSize | |
System.Int32 | startColumnIndex | The start index of the column to calculate the column for page. |
System.Int32 | endColumnIndex | The end index of the column to calculate the column for page. |
Remarks
Override this method and customize the column calculation for page during printing process.
ComputePages(IList, Size)
Calculates the number of pages recommended to arrange the specified source with in the available size.
Declaration
protected virtual void ComputePages(IList source, Size avaliableSize)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IList | source | The list of source collection to compute page count. |
Windows.Foundation.Size | avaliableSize | The desired size of the page. |
Remarks
Override this method and customize page calculation for printing.
CreatePage(Int32)
Creates the page for the specified page index and arrange the SfDataGrid content with in that page.
Declaration
protected virtual PrintPageControl CreatePage(int pageIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageIndex | The corresponding page index to create page. |
Returns
Type | Description |
---|---|
PrintPageControl | Returns the new PrintPageControl for the specified index. |
CreatePage(Int32, PrintPageControl)
Creates the page corresponding to the specified page index and page control.
Declaration
protected virtual PrintPageControl CreatePage(int pageIndex, PrintPageControl pageControl)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageIndex | The corresponding page index to create page. |
PrintPageControl | pageControl | The corresponding page control to create page. |
Returns
Type |
---|
PrintPageControl |
Dispose()
Releases all the resources used by the PrintManagerBase class.
Declaration
public void Dispose()
Dispose(Boolean)
Disposes all the resources used by the PrintManagerBase class.
Declaration
protected virtual void Dispose(bool isDisposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isDisposing | Indicates whether the call is from Dispose method or from a finalizer. |
Finalize()
Declaration
protected override void Finalize()
GetColumnElement(Object, String)
Gets the column element of the specified record and mapping name for printing each GridCell in a column.
Declaration
protected virtual object GetColumnElement(object record, string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | Specifies the corresponding record to get the column element. |
System.String | mappingName | The corresponding mappingName of the column to get its column element. |
Returns
Type | Description |
---|---|
System.Object | Returns the column element of the specified record and mapping name. |
Remarks
Override this method and customize the column element based on its record and mapping name.
GetColumnHeaderElement(String)
Gets the header UIElement of the column corresponding to its mapping name for printing the header cell of a column.
Declaration
protected virtual UIElement GetColumnHeaderElement(string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mappingName | The corresponding mappingName of the column to get its header element. |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.UIElement | Returns the header UIElement of the specified mapping name. |
Remarks
Override this method and customize the header UIElement of column based on its mapping name.
GetColumnHeaderText(String)
Gets the header text of the column for the specified mapping name.
Declaration
protected virtual string GetColumnHeaderText(string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mappingName | The corresponding mappingName of the column to get its header text. |
Returns
Type | Description |
---|---|
System.String | Returns the header text of column for the specified mapping name. |
Remarks
Override this method and customize the header text of the column based on its mapping name.
GetColumnNames()
Gets the list of column names collection that need to be printed.
Declaration
protected virtual List<string> GetColumnNames()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | Returns the collection of column name collection that need to be printed. |
GetColumnPadding(String)
Gets the padding of the column for the specified mapping name.
Declaration
protected virtual Thickness GetColumnPadding(string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mappingName | The corresponding mappingName of the column to get its padding. |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.Thickness | Returns the padding of column for the specified mapping name. |
Remarks
Override this method and customize the padding for column based on its mapping name.
GetColumnTextAlignment(String)
Gets the
Declaration
protected virtual TextAlignment GetColumnTextAlignment(string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mappingName | The corresponding mappingName of the column to get its |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.TextAlignment | Returns the |
Remarks
Override this method and customize the
GetColumnTextWrapping(String)
Gets the
Declaration
protected virtual TextWrapping GetColumnTextWrapping(string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mappingName | The corresponding mappingName of the column to get its |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.TextWrapping | Returns the |
Remarks
Override this method and customize the
GetColumnWidth(String)
Gets the column width for the specified mapping name of column.
Declaration
protected virtual double GetColumnWidth(string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mappingName | The corresponding mappingName of the column to get its width. |
Returns
Type | Description |
---|---|
System.Double | Returns the column width of the specified mapping name. |
Remarks
Override this method and customize the column width based on the mapping name of the column.
GetGroupCaptionStringFormat()
Gets the string format of group caption.
Declaration
protected virtual string GetGroupCaptionStringFormat()
Returns
Type | Description |
---|---|
System.String | Returns the corresponding string format of group caption. |
Remarks
Override this method and customize string format of group caption.
GetPagesPerRecord(List<String>, Double)
Gets the number of records arranged to each page for the specified column names and the available page width.
Declaration
protected virtual int GetPagesPerRecord(List<string> columnNames, double avaliableWidth)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.String> | columnNames | The list of column name collection to get the pages per record count. |
System.Double | avaliableWidth | The available width of the page. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the number of pages per record. |
Remarks
Override this method and customize the page count option for printing.
GetPrintCaptionSummaryCell(Object, String)
Returns the caption summary cell for the specified record and mapping name for printing.
Declaration
public virtual ContentControl GetPrintCaptionSummaryCell(object record, string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | The corresponding record to print caption summary cell. |
System.String | mappingName | The corresponding mapping name to print caption summary cell. |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.Controls.ContentControl | Returns the GridGridCaptionSummaryCell if the AllowPrintStyles is true; otherwise return the PrintCaptionSummaryCell. |
GetPrintGridCell(Object, String)
Returns the grid cell for the specified record and mapping name for printing.
Declaration
public virtual ContentControl GetPrintGridCell(object record, string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | The corresponding record to print grid cell. |
System.String | mappingName | The corresponding mapping name to print grid cell. |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.Controls.ContentControl | Returns the GridCell if the AllowPrintStyles is true; otherwise return the PrintGridCell. |
GetPrintGroupSummaryCell(Object, String)
Returns the group summary cell for the specified record and mapping name for printing.
Declaration
public virtual ContentControl GetPrintGroupSummaryCell(object record, string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | The corresponding record to print group summary cell. |
System.String | mappingName | The corresponding mapping name to print group summary cell. |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.Controls.ContentControl | Returns the GridGroupSummaryCell if the AllowPrintStyles is true; otherwise return the PrintGroupSummaryCell. |
GetPrintHeaderCell(String)
Returns the header cell for the specified record and mapping name for printing.
Declaration
public virtual ContentControl GetPrintHeaderCell(string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mappingName | The corresponding mapping name to print header cell. |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.Controls.ContentControl | Returns the GridHeaderCellControl if the AllowPrintStyles is true; otherwise return the PrintHeaderCell. |
GetPrintTableSummaryCell(Object, String)
Returns the table summary cell for the specified record and mapping name for printing.
Declaration
public virtual ContentControl GetPrintTableSummaryCell(object record, string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | The corresponding record to print table summary cell. |
System.String | mappingName | The corresponding mapping name to print table summary cell. |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.Controls.ContentControl | Returns the GridTableSummaryCell if the AllowPrintStyles is true; otherwise return the PrintTableSummaryCell. |
GetPrintUnboundRowCell(Object, String)
Returns the UnboundRow cell for the specified record and mapping name for printing.
Declaration
public virtual ContentControl GetPrintUnboundRowCell(object record, string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | The corresponding record to print UnboundRow cell. |
System.String | mappingName | The corresponding mapping name to print UnboundRow cell. |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.Controls.ContentControl | Returns the GridUnboundRowCell if the AllowPrintStyles is true; otherwise return the PrintUnboundRowCell. |
GetRecordFromSourceList(Int32)
Gets the record from the source list collection for the specified record index.
Declaration
protected virtual object GetRecordFromSourceList(int recordIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | recordIndex | The recordIndex to get the record from the source list collection. |
Returns
Type | Description |
---|---|
System.Object | Returns the record for the specified record index. |
Remarks
Override this method and customize the record of the source list collection before printing.
GetRowHeight(Object, Int32, RowType)
Gets the row height for the specified record and row index.
Declaration
protected virtual double GetRowHeight(object record, int rowindex, RowType rowtype)
Parameters
Type | Name | Description |
---|---|---|
System.Object | record | The corresponding record to get the row height. |
System.Int32 | rowindex | Index of the record in SourceList |
RowType | rowtype |
Returns
Type | Description |
---|---|
System.Double | Returns the row height of the specified record and row index. |
Remarks
Override this method and customize the row height of the SfDataGrid for printing.
GetSourceListForPrinting()
Gets the corresponding data source for printing.
Declaration
protected virtual IList GetSourceListForPrinting()
Returns
Type | Description |
---|---|
System.Collections.IList | Returns the corresponding data source. |
GetStackedColumnHeaderElement(String)
Gets the StackedHeader UIElement of the column corresponding to its mapping name for printing the header cell of a column.
Declaration
protected virtual UIElement GetStackedColumnHeaderElement(string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mappingName | The corresponding mappingName of the column to get its header element. |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.UIElement | Returns the Stacked Header UIElement of the specified mapping name. |
Remarks
Override this method and customize the header UIElement of column based on its mapping name. ///
GetTableSummaryList(TableSummaryRowPosition)
Gets the list of SummaryRecordEntry to get the table summary based on its position for printing.
Declaration
protected IList<SummaryRecordEntry> GetTableSummaryList(TableSummaryRowPosition position)
Parameters
Type | Name | Description |
---|---|---|
TableSummaryRowPosition | position | The corresponding TableSummaryRowPosition to get the table summary list. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<SummaryRecordEntry> | Returns the list of SummaryRecordEntry. |
GetTotalRecordCount()
Gets the total number of records count for printing.
Declaration
protected virtual int GetTotalRecordCount()
Returns
Type | Description |
---|---|
System.Int32 | The total number of records count for printing. |
GetTotalRecordsHeight()
Gets the height of total records in SfDataGrid.
Declaration
protected double GetTotalRecordsHeight()
Returns
Type | Description |
---|---|
System.Double | Returns the height of total records in SfDataGrid. |
InitializeHeadersForPage(List<RowInfo>, Int32, List<String>, Int32, Int32)
Initializes the header of specified list of column name to the particular page corresponding to the start and end of the column index.
Declaration
protected void InitializeHeadersForPage(List<RowInfo> rowDictionary, int pageIndex, List<string> columnNames, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<RowInfo> | rowDictionary | The rowDictionary to add the header cell info in page. |
System.Int32 | pageIndex | The corresponding index of page to initialize headers. |
System.Collections.Generic.List<System.String> | columnNames | The list of column names collection to initialize its headers for the specified page index. |
System.Int32 | startColumnIndex | The start index of the column to initialize its headers on particular page. |
System.Int32 | endColumnIndex | The end index of the column to initialize its headers on particular page. |
InitializePrint(Boolean)
Initializes the print process such as print properties,settings and Construct PageDictonary,RowDictonary.
Declaration
protected virtual void InitializePrint(bool needToInitProperties)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | needToInitProperties | Indicates whether the print properties and settings is initialized before printing. |
InitializeProperties()
Initializes properties and settings for printing process.
Declaration
protected virtual void InitializeProperties()
InitializeStackedHeaderForPage(List<RowInfo>, Int32, Int32, Int32, Int32)
Initializes the header of specified list of column name to the particular page corresponding to the start and end of the column index.
Declaration
protected virtual void InitializeStackedHeaderForPage(List<RowInfo> rowDictionary, int pageIndex, int startColumnIndex, int endColumnIndex, int start)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<RowInfo> | rowDictionary | The rowDictionary to add the header cell info in page. |
System.Int32 | pageIndex | The corresponding index of page to initialize headers. |
System.Int32 | startColumnIndex | The start index of the column to initialize its headers on particular page. |
System.Int32 | endColumnIndex | The end index of the column to initialize its headers on particular page. |
System.Int32 | start | The index for the Stacked Header. |
OnAddPrintPages(AddPagesEventArgs)
Occurs when the PrintManager requests the final collection of pages to print.
Declaration
protected virtual void OnAddPrintPages(AddPagesEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Windows.UI.Xaml.Printing.AddPagesEventArgs | e | The Windows.UI.Xaml.Printing.AddPagesEventArgs instance that contains the event data. |
Examples
The following example show how to print specific pages by overriding OnAddPrintPages method.
public class CustomPrintManager : GridPrintManager
{
public CustomPrintManager(SfDataGrid grid)
: base(grid)
{
}
protected override void OnAddPrintPages(AddPagesEventArgs e)
{
IList<Windows.Graphics.Printing.PrintPageRange> customPageRanges = e.PrintTaskOptions.CustomPageRanges;
int pageCount = this.PageDictionary.Count;
// An empty CustomPageRanges means "All Pages"
if (customPageRanges.Count == 0)
{
// Loop over all of the preview pages and add each one to be printed
for (var i = 1; i <= pageCount; i++)
{
var printpageControl = CreatePage(i);
PrintDocument.AddPage(printpageControl);
}
}
else
{
// Print only the pages chosen by the user.
//
// The "Current page" option is a special case of "Custom set of pages".
// In case the user selects the "Current page" option, the PrintDialog
// will turn that into a CustomPageRanges containing the page that the user was looking at.
// If the user typed in an indefinite range such as "6-", the LastPageNumber value
// will be whatever this sample app last passed into the PrintDocument.SetPreviewPageCount API.
foreach (PrintPageRange pageRange in customPageRanges)
{
// The user may type in a page number that is not present in the document.
// In this case, we just ignore those pages, hence the checks
// (pageRange.FirstPageNumber <= printPreviewPages.Count) and (i <= printPreviewPages.Count).
//
// If the user types the same page multiple times, it will be printed multiple times
// (e.g 3-4;1;1 will print pages 3 and 4 followed by two copies of page 1)
if (pageRange.FirstPageNumber <= pageCount)
{
for (int i = pageRange.FirstPageNumber; (i <= pageRange.LastPageNumber) && (i <= pageCount); i++)
{
// Subtract 1 because page numbers are 1-based, but our list is 0-based.
var printpageControl = CreatePage(i);
PrintDocument.AddPage(printpageControl);
}
}
}
}
// Indicate that all of the print pages have been provided.
PrintDocument.AddPagesComplete();
}
}
dataGrid.PrintSettings.PrintManagerBase = new CustomPrintManager(this.dataGrid);
dataGrid.PrintSettings.PrintManagerBase.Print();
OnCreatePrintPreviewPages(Object, PaginateEventArgs)
Declaration
protected virtual void OnCreatePrintPreviewPages(object sender, PaginateEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
Windows.UI.Xaml.Printing.PaginateEventArgs | e |
Print()
Prints the content of SfDataGrid.
Declaration
public virtual void Print()
SetTotalRecordsHeight(Double)
Sets the height of all total records in SfDataGrid for printing.
Declaration
protected void SetTotalRecordsHeight(double totalheight)
Parameters
Type | Name | Description |
---|---|---|
System.Double | totalheight | The total height of all records in SfDataGrid. |
ToIEnumerable<NodeEntry>(IEnumerator<NodeEntry>)
Converts an enumerator sequence to an enumerable sequence.
Declaration
public static IEnumerable<NodeEntry> ToIEnumerable<NodeEntry>(IEnumerator<NodeEntry> enumerator)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerator<NodeEntry> | enumerator | An enumerator node entry sequence to convert enumerable node entry. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<NodeEntry> | The enumerable sequence containing the node entry in the enumerator sequence. |
Type Parameters
Name | Description |
---|---|
NodeEntry | The type of enumerator. |
Events
PropertyChanged
Occurs when a property value changes in PrintManagerBase class.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type |
---|
System.ComponentModel.PropertyChangedEventHandler |