Class DataGridPrintManager
A class which manages the print operations of the SfDataGrid
Implements
Inherited Members
Namespace: Syncfusion.UI.Xaml.DataGrid.Print
Assembly: Syncfusion.Grid.WinUI.dll
Syntax
public class DataGridPrintManager : NotificationObject, INotifyPropertyChanged, IDisposable
Constructors
DataGridPrintManager(SfDataGrid)
Initializes a new instance of DataGridPrintManager class.
Declaration
public DataGridPrintManager(SfDataGrid datagrid)
Parameters
Type | Name | Description |
---|---|---|
SfDataGrid | datagrid | The instance of the SfDataGrid. |
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. |
dataGrid
Gets the reference to the SfDataGrid control.
Declaration
protected SfDataGrid dataGrid { get; }
Property Value
Type | Description |
---|---|
SfDataGrid | The reference to the SfDataGrid control. |
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<DataGridPrintRowInfo>> PageDictionary { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Int32, System.Collections.Generic.List<DataGridPrintRowInfo>> | The row info of each page. |
PrintDocument
Gets the PrintDocument to be printed.
Declaration
protected PrintDocument PrintDocument { get; }
Property Value
Type |
---|
Microsoft.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 |
---|---|
Microsoft.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 |
---|---|
Microsoft.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 |
---|---|
Microsoft.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 |
---|---|
Microsoft.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 Windows.Graphics.Printing.PrintOrientation enumeration that specifies how the page content is oriented. The default orientation is Windows.Graphics.Printing.PrintOrientation.Portrait. |
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. |
PrintScalingOption
Gets or sets a value indicating how the page content is scaled for printing.
Declaration
public PrintScalingOptions PrintScalingOption { get; set; }
Property Value
Type | Description |
---|---|
PrintScalingOptions | One of the PrintScalingOptions enumeration that specifies how the page content is scaled. The default orientation is NoScaling. |
Provider
Gets or sets the IPropertyAccessProvider.
Declaration
protected IPropertyAccessProvider Provider { get; set; }
Property Value
Type |
---|
IPropertyAccessProvider |
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
AddCaptionSummaryRowToPagePanel(DataGridPrintPagePanel, DataGridPrintRowInfo)
Adds the caption summary row to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddCaptionSummaryRowToPagePanel(DataGridPrintPagePanel panel, DataGridPrintRowInfo rowInfo)
Parameters
Type | Name | Description |
---|---|---|
DataGridPrintPagePanel | panel | The corresponding panel to add the caption summary row for printing. |
DataGridPrintRowInfo | rowInfo | The corresponding DataGridPrintRowInfo that is added to the panel for printing. |
AddGroupSummaryRowToPagePanel(DataGridPrintPagePanel, DataGridPrintRowInfo)
Adds the group summary row to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddGroupSummaryRowToPagePanel(DataGridPrintPagePanel panel, DataGridPrintRowInfo rowInfo)
Parameters
Type | Name | Description |
---|---|---|
DataGridPrintPagePanel | panel | The corresponding panel to add the group summary row for printing. |
DataGridPrintRowInfo | rowInfo | The corresponding DataGridPrintRowInfo that is added to the panel for printing. |
AddHeaderRowToPagePanel(DataGridPrintPagePanel, DataGridPrintRowInfo)
Adds the header row to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddHeaderRowToPagePanel(DataGridPrintPagePanel panel, DataGridPrintRowInfo rowInfo)
Parameters
Type | Name | Description |
---|---|---|
DataGridPrintPagePanel | panel | The corresponding panel to add the header row for printing. |
DataGridPrintRowInfo | rowInfo | The corresponding DataGridPrintRowInfo that is added to the panel for printing. |
AddParentRecordInfoToDict(List<DataGridPrintRowInfo>, Object, List<GridColumn>, ref Double, Int32, Int32)
Adds the parent record information to dictionary that is going to be printed.
Declaration
protected bool AddParentRecordInfoToDict(List<DataGridPrintRowInfo> rowDictionary, object data, List<GridColumn> columns, ref double yPosition, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<DataGridPrintRowInfo> | rowDictionary | The rowDictionary to add the parent record information in page for printing. |
System.Object | data | The corresponding record information of parent that is added in to dictionary. |
System.Collections.Generic.List<GridColumn> | columns | The list of column names collection that is used to measures the number of column arranged in a page. |
System.Double | yPosition | 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. |
AddRecordToPagePanel(DataGridPrintPagePanel, DataGridPrintRowInfo)
Adds the data row to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddRecordToPagePanel(DataGridPrintPagePanel panel, DataGridPrintRowInfo rowInfo)
Parameters
Type | Name | Description |
---|---|---|
DataGridPrintPagePanel | panel | The corresponding panel to add the data row for printing. |
DataGridPrintRowInfo | rowInfo | The corresponding DataGridPrintRowInfo that is added to the panel for printing. |
AddRowInformationToDictionary(Object, List<GridColumn>, Double, Int32, Int32)
Adds the row information to dictionary that is going to be printed.
Declaration
protected virtual List<DataGridPrintCellInfo> AddRowInformationToDictionary(object data, List<GridColumn> columns, double yPosition, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The corresponding data information of row is added to dictionary. |
System.Collections.Generic.List<GridColumn> | columns | The list of columns collection that is used to measures the number of columns arranged in a page. |
System.Double | yPosition | 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<DataGridPrintCellInfo> | Returns the list of cell info that is going to be printed. |
Remarks
Invoked to add rows such as normal row, group caption summary row, summary row, table summary row to dictionary for printing.
AddRowToPrintPagePanel(DataGridPrintPagePanel, DataGridPrintRowInfo, Int32)
Adds the row info to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddRowToPrintPagePanel(DataGridPrintPagePanel panel, DataGridPrintRowInfo rowInfo, int pageIndex)
Parameters
Type | Name | Description |
---|---|---|
DataGridPrintPagePanel | panel | The corresponding panel to add the row that is to be printed. |
DataGridPrintRowInfo | 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.
AddStackedHeaderRowToPagePanel(DataGridPrintPagePanel, DataGridPrintRowInfo)
Adds the stacked header row to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddStackedHeaderRowToPagePanel(DataGridPrintPagePanel panel, DataGridPrintRowInfo rowinfo)
Parameters
Type | Name | Description |
---|---|---|
DataGridPrintPagePanel | panel | The corresponding panel to add the stacked header row for printing. |
DataGridPrintRowInfo | rowinfo | The corresponding DataGridPrintRowInfo that is added to the panel for printing. |
AddTableSummaryRowToPagePanel(DataGridPrintPagePanel, DataGridPrintRowInfo)
Adds the table summary row to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddTableSummaryRowToPagePanel(DataGridPrintPagePanel panel, DataGridPrintRowInfo rowInfo)
Parameters
Type | Name | Description |
---|---|---|
DataGridPrintPagePanel | panel | The corresponding panel to add the table summary row for printing. |
DataGridPrintRowInfo | rowInfo | The corresponding DataGridPrintRowInfo that is added to the panel for printing. |
AddUnboundRowToPrintPagePanel(DataGridPrintPagePanel, DataGridPrintRowInfo)
Adds the UnboundRow info to the specified print page panel that is going to be printed.
Declaration
protected virtual void AddUnboundRowToPrintPagePanel(DataGridPrintPagePanel panel, DataGridPrintRowInfo rowInfo)
Parameters
Type | Name | Description |
---|---|---|
DataGridPrintPagePanel | panel | The corresponding panel to add the UnboundRow that is to be printed. |
DataGridPrintRowInfo | rowInfo | The corresponding UnboundRow information that is added to panel. |
ComputeColumnForPage(Int32, List<GridColumn>, 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<GridColumn> columns, 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<GridColumn> | columns | The list of column names collection to arrange the column with in the specified page index. |
Windows.Foundation.Size | avaliableSize | The available size of the page. |
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 within specified page.
Declaration
protected virtual DataGridPrintPageControl CreatePage(int pageIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageIndex | The corresponding page index to create page. |
Returns
Type | Description |
---|---|
DataGridPrintPageControl | Returns the new DataGridPrintPageControl for the specified index. |
CreatePage(Int32, DataGridPrintPageControl)
Creates the page corresponding to the specified page index and page control.
Declaration
protected virtual DataGridPrintPageControl CreatePage(int pageIndex, DataGridPrintPageControl pageControl)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageIndex | The corresponding page index to create page. |
DataGridPrintPageControl | pageControl | The corresponding page control to create page. |
Returns
Type |
---|
DataGridPrintPageControl |
Dispose()
Releases all the resources used by DataGridPrintManager.
Declaration
public void Dispose()
Dispose(Boolean)
Disposes all the resources used by the SfDataGrid class.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
GetColumnElement(Object, String)
Gets the column element of the specified data and mapping name for printing each GridCell in a column.
Declaration
protected virtual object GetColumnElement(object data, string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | Specifies the corresponding data 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 data and mapping name. |
Remarks
Override this method and customize the column element based on its data 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 |
---|---|
Microsoft.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.
GetColumns()
Gets the list of columns that need to be printed.
Declaration
protected virtual List<GridColumn> GetColumns()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<GridColumn> | Returns the collection of columns that need to be printed. |
GetColumnTextAlignment(String)
Gets the text alignment of the column.
Declaration
protected virtual TextAlignment GetColumnTextAlignment(string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mappingName | The corresponding column to get its text alignment. |
Returns
Type | Description |
---|---|
Microsoft.UI.Xaml.TextAlignment | Returns the text alignment of column. |
GetColumnTextWrapping(String)
Gets the text wrapping of the column.
Declaration
protected virtual TextWrapping GetColumnTextWrapping(string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mappingName | The corresponding column to get its text wrapping. |
Returns
Type | Description |
---|---|
Microsoft.UI.Xaml.TextWrapping | Returns the text wrapping of column. |
GetColumnWidth(String)
Gets the width of the column.
Declaration
protected virtual double GetColumnWidth(string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mappingName | The corresponding column to get its width. |
Returns
Type | Description |
---|---|
System.Double | Returns the width of column. |
GetGroupCaptionStringFormat()
Gets the string format of group caption.
Declaration
protected virtual string GetGroupCaptionStringFormat()
Returns
Type |
---|
System.String |
GetPrintCaptionSummaryCell(Object, GridColumn)
Returns the caption summary cell for the specified data and column for printing.
Declaration
protected virtual ContentControl GetPrintCaptionSummaryCell(object data, GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The corresponding data to print caption summary cell. |
GridColumn | column | The corresponding column to print caption summary cell. |
Returns
Type | Description |
---|---|
Microsoft.UI.Xaml.Controls.ContentControl | Returns the GridCaptionSummaryCell if the CanPrintStyles is true; otherwise return the PrintCaptionSummaryCell. |
GetPrintGridCell(Object, GridColumn)
Returns the data row cell for the specified data and column for printing.
Declaration
protected virtual ContentControl GetPrintGridCell(object data, GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The corresponding data to print data row cell. |
GridColumn | column | The corresponding column to print data row cell. |
Returns
Type | Description |
---|---|
Microsoft.UI.Xaml.Controls.ContentControl | Returns the GridCell if the AllowPrintStyles is true; otherwise return the PrintGridCell. |
GetPrintGroupSummaryCell(Object, GridColumn)
Returns the group summary row cell for the specified data and column for printing.
Declaration
protected virtual ContentControl GetPrintGroupSummaryCell(object data, GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The corresponding data to print group summary row cell. |
GridColumn | column | The corresponding column to print group summary row cell. |
Returns
Type | Description |
---|---|
Microsoft.UI.Xaml.Controls.ContentControl | Returns the GridGroupSummaryCell if the CanPrintStyles is true; otherwise return the PrintGroupSummaryCell. |
GetPrintHeaderCell(GridColumn)
Returns the header row cell for the specified data and column for printing.
Declaration
protected virtual ContentControl GetPrintHeaderCell(GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
GridColumn | column | The corresponding column to print header row cell. |
Returns
Type | Description |
---|---|
Microsoft.UI.Xaml.Controls.ContentControl | Returns the GridHeaderCellControl if the CanPrintStyles is true; otherwise return the PrintHeaderCell. |
GetPrintTableSummaryCell(Object, GridColumn)
Returns the table summary row cell for the specified data and column for printing.
Declaration
protected virtual ContentControl GetPrintTableSummaryCell(object data, GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The corresponding data to print table summary row cell. |
GridColumn | column | The corresponding column to print table summary row cell. |
Returns
Type | Description |
---|---|
Microsoft.UI.Xaml.Controls.ContentControl | Returns the GridTableSummaryCell if the CanPrintStyles is true; otherwise return the PrintTableSummaryCell. |
GetPrintUnboundRowCell(Object, GridColumn)
Returns the unbound row cell for the specified data and column for printing.
Declaration
protected virtual ContentControl GetPrintUnboundRowCell(object data, GridColumn column)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The corresponding data to print unbound row cell. |
GridColumn | column | The corresponding column to print unbound row cell. |
Returns
Type | Description |
---|---|
Microsoft.UI.Xaml.Controls.ContentControl | Returns the GridUnboundRowCell if the CanPrintStyles 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.
GetRecordsPerPages(List<GridColumn>, Double)
Gets the number of records arranged to each page for the specified columns and the available page width.
Declaration
protected virtual int GetRecordsPerPages(List<GridColumn> columns, double avaliableWidth)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<GridColumn> | columns | The list of columns to get the records per page count. |
System.Double | avaliableWidth | The available width of the page. |
Returns
Type |
---|
System.Int32 |
GetRowHeight(Object, Int32, RowType)
Gets the row height for the specified data and row index.
Declaration
protected virtual double GetRowHeight(object data, int rowindex, RowType rowtype)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The corresponding data to get the row height. |
System.Int32 | rowindex | Index of the data in SourceList |
RowType | rowtype | The corresponding row type. |
Returns
Type | Description |
---|---|
System.Double | Returns the row height of the specified data 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 |
---|---|
Microsoft.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. ///
GetStackedHeaders()
Get the Stacked Headers count.
Declaration
protected virtual int GetStackedHeaders()
Returns
Type | Description |
---|---|
System.Int32 | Return thecount of the stacked headers to be pinted. |
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. |
InitializeHeadersForPage(List<DataGridPrintRowInfo>, Int32, List<GridColumn>, 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<DataGridPrintRowInfo> rowDictionary, int pageIndex, List<GridColumn> columns, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<DataGridPrintRowInfo> | 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<GridColumn> | columns | 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<DataGridPrintRowInfo>, 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<DataGridPrintRowInfo> rowDictionary, int pageIndex, int startColumnIndex, int endColumnIndex, int start)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<DataGridPrintRowInfo> | 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 |
---|---|---|
Microsoft.UI.Xaml.Printing.AddPagesEventArgs | e | The |
Examples
public class CustomPrintManager : DataGridPrintManager
{
public CustomPrintManager(SfDataGrid grid)
: base(grid)
{
}
protected override void OnAddPrintPages(AddPagesEventArgs e)
{
//Do your customization.
}
}
dataGrid.PrintSettings.PrintManager = new CustomPrintManager(this.dataGrid);
dataGrid.PrintSettings.PrintManager.Print();
OnCreatePrintPreviewPages(Object, PaginateEventArgs)
Creates the print preview pages and print settings
Declaration
protected virtual void OnCreatePrintPreviewPages(object sender, PaginateEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The sender. |
Microsoft.UI.Xaml.Printing.PaginateEventArgs | e | The Microsoft.UI.Xaml.Printing.PaginateEventArgs instance containing the event data. |
OnPrintTaskRequested(PrintManager, PrintTaskRequestedEventArgs)
Raised when a request to print has occurred.
Declaration
protected virtual void OnPrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Windows.Graphics.Printing.PrintManager | sender | The sender. |
Windows.Graphics.Printing.PrintTaskRequestedEventArgs | args | The Windows.Graphics.Printing.PrintTaskRequestedEventArgs instance containing the event data. |
PrepareCaptionSummaryRowCells(Object, List<GridColumn>, Double, Int32, Int32)
Prepares the cells that is going to be printed for caption summary row.
Declaration
protected virtual List<DataGridPrintCellInfo> PrepareCaptionSummaryRowCells(object data, List<GridColumn> columns, double yPosition, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The corresponding data of caption summary row. |
System.Collections.Generic.List<GridColumn> | columns | The list of columns that is used to measures the number of columns arranged in a page. |
System.Double | yPosition | The y position of the page. |
System.Int32 | startColumnIndex | The start index of the column to add caption summary row for printing. |
System.Int32 | endColumnIndex | The end index of the column to add caption summary row for printing. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<DataGridPrintCellInfo> | Returns the DataGridPrintCellInfo that is going to be printed. |
PrepareGroupSummaryRowCells(Object, List<GridColumn>, Double, Int32, Int32)
Prepares the cells that is going to be printed for data row.
Declaration
protected virtual List<DataGridPrintCellInfo> PrepareGroupSummaryRowCells(object data, List<GridColumn> columns, double yPosition, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The corresponding data of group summary row. |
System.Collections.Generic.List<GridColumn> | columns | The list of columns that is used to measures the number of columns arranged in a page. |
System.Double | yPosition | The y position of the page. |
System.Int32 | startColumnIndex | The start index of the column to add group summary row for printing. |
System.Int32 | endColumnIndex | The end index of the column to add group summary row for printing. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<DataGridPrintCellInfo> | Returns the DataGridPrintCellInfo that is going to be printed. |
PrepareHeaderRowCells(List<GridColumn>, Double, Int32, Int32)
Prepares the cells that is going to be printed for header row.
Declaration
protected virtual List<DataGridPrintCellInfo> PrepareHeaderRowCells(List<GridColumn> columns, double yPosition, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<GridColumn> | columns | The list of columns that is used to measures the number of columns arranged in a page. |
System.Double | yPosition | The y position of the page. |
System.Int32 | startColumnIndex | The start index of the column to add header row for printing. |
System.Int32 | endColumnIndex | The end index of the column to add header row for printing. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<DataGridPrintCellInfo> | Returns the DataGridPrintCellInfo that is going to be printed. |
PrepareRecordCells(Object, List<GridColumn>, Double, Int32, Int32)
Prepares the records cells that is going to be printed for data row.
Declaration
protected virtual List<DataGridPrintCellInfo> PrepareRecordCells(object data, List<GridColumn> columns, double yPosition, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The corresponding data of data row. |
System.Collections.Generic.List<GridColumn> | columns | The list of columns that is used to measures the number of column arranged in a page. |
System.Double | yPosition | The y position of the page. |
System.Int32 | startColumnIndex | The start index of the column to add data row for printing. |
System.Int32 | endColumnIndex | The end index of the column to add data row for printing. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<DataGridPrintCellInfo> | Returns the DataGridPrintCellInfo that is going to be printed. |
PrepareStackedHeaderRowCells(Double, Int32, Int32, Int32)
Prepares the cells that is going to be printed for stacked header row.
Declaration
protected virtual List<DataGridPrintCellInfo> PrepareStackedHeaderRowCells(double yPosition, int startColumnIndex, int endColumnIndex, int rowStart)
Parameters
Type | Name | Description |
---|---|---|
System.Double | yPosition | The y position of the page. |
System.Int32 | startColumnIndex | The start index of the column to add stacked header row for printing. |
System.Int32 | endColumnIndex | The end index of the column to add stacked header row for printing. |
System.Int32 | rowStart |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<DataGridPrintCellInfo> | Returns the DataGridPrintCellInfo that is going to be printed. |
PrepareTableSummaryRowCells(Object, List<GridColumn>, Double, Int32, Int32)
Prepares the cells that is going to be printed for table summary row.
Declaration
protected virtual List<DataGridPrintCellInfo> PrepareTableSummaryRowCells(object data, List<GridColumn> columns, double yPosition, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The corresponding data of data row. |
System.Collections.Generic.List<GridColumn> | columns | The list of columns that is used to measures the number of columns arranged in a page. |
System.Double | yPosition | The y position of the page. |
System.Int32 | startColumnIndex | The start index of the column to add table summary row for printing. |
System.Int32 | endColumnIndex | The end index of the column to add table summary row for printing. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<DataGridPrintCellInfo> | Returns the DataGridPrintCellInfo that is going to be printed. |
PrepareUnboundRowCells(Object, List<GridColumn>, Double, Int32, Int32)
Adds the UnBoundRow information to dictionary that is going to be printed.
Declaration
protected virtual List<DataGridPrintCellInfo> PrepareUnboundRowCells(object data, List<GridColumn> columns, double yPosition, int startColumnIndex, int endColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The corresponding record information of UnboundRow is added to dictionary. |
System.Collections.Generic.List<GridColumn> | columns | The list of column collection that is used to measures the number of columns arranged in a page. |
System.Double | yPosition | 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<DataGridPrintCellInfo> | Returns the list of UnboundRow cell info that is going to be printed. |
Print()
Prints the content of the SfDataGrid.
Declaration
public virtual void Print()