Class PrintManagerBase
Provides the base implementation for printing related operation in SfDataGrid.
Implements
Namespace: Syncfusion.UI.Xaml.Grid
Assembly: Syncfusion.SfGrid.WPF.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. |
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. |
AllowPrintByDrawing
Gets or sets a value that indicates whether the SfDataGrid is printed using drawing concept instead of creating cell.
Declaration
protected bool AllowPrintByDrawing { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the print job is done by drawing concept; otherwise, false. |
Remarks
Printing using drawing concept provides better performance.
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. |
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 |
---|---|
System.Windows.FlowDirection | One of the System.Windows.FlowDirection that specifies the direction of page content. The default direction is System.Windows.FlowDirection.LeftToRight. |
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 System.Windows.DataTemplate that defines the visual representation of the page footer for printing.
Declaration
public DataTemplate PrintPageFooterTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.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 System.Windows.DataTemplate that defines the visual representation of the page header for printing.
Declaration
public DataTemplate PrintPageHeaderTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.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 |
---|---|
System.Windows.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 |
---|---|
PrintOrientation | One of the PrintOrientation enumeration that specifies how the page content is oriented. The default orientation is 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. |
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. |
System.Windows.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. |
System.Windows.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. |
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 |
---|---|
System.Windows.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 |
---|---|
System.Windows.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 System.Windows.TextAlignment of the column for the specified mapping name.
Declaration
protected virtual TextAlignment GetColumnTextAlignment(string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mappingName | The corresponding mappingName of the column to get its System.Windows.TextAlignment. |
Returns
Type | Description |
---|---|
System.Windows.TextAlignment | Returns the System.Windows.TextAlignment of column for the specified mapping name. |
Remarks
Override this method and customize the System.Windows.TextAlignment for column based on its mapping name.
GetColumnTextWrapping(String)
Gets the System.Windows.TextWrapping of the column for the specified mapping name.
Declaration
protected virtual TextWrapping GetColumnTextWrapping(string mappingName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mappingName | The corresponding mappingName of the column to get its System.Windows.TextWrapping. |
Returns
Type | Description |
---|---|
System.Windows.TextWrapping | Returns the System.Windows.TextWrapping of column for the specified mapping name. |
Remarks
Override this method and customize the System.Windows.TextWrapping of column based on its mapping name.
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.
GetFormattedText(RowInfo, CellInfo, String)
Returns the formatted text for the specified cell information.
Declaration
protected virtual FormattedText GetFormattedText(RowInfo rowInfo, CellInfo cellInfo, string cellValue)
Parameters
Type | Name | Description |
---|---|---|
RowInfo | rowInfo | The corresponding row information to get formatted text. |
CellInfo | cellInfo | The corresponding cell information to get formatted text. |
System.String | cellValue | The corresponding cell value to get formatted text. |
Returns
Type | Description |
---|---|
System.Windows.Media.FormattedText | Returns the System.Windows.Media.FormattedText for the specified cell information. |
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 |
---|---|
System.Windows.Controls.ContentControl | Returns the GridGridCaptionSummaryCell if the AllowPrintStyles is true; otherwise return the PrintCaptionSummaryCell. |
GetPrintDocument()
Gets the print document of SfDataGrid.
Declaration
public virtual FixedDocument GetPrintDocument()
Returns
Type | Description |
---|---|
System.Windows.Documents.FixedDocument | Returns the System.Windows.Documents.FixedDocument that contains the print document of SfDataGrid. |
GetPrintDocument(Int32, Int32)
Gets the print document of SfDatGrid based on the specified start and end index of page.
Declaration
public virtual FixedDocument GetPrintDocument(int start, int end)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | start | The start index of the page to get print document. |
System.Int32 | end | The end index of the page to get print document. |
Returns
Type | Description |
---|---|
System.Windows.Documents.FixedDocument | Returns the System.Windows.Documents.FixedDocument for the specified start and end index of the page contains the print document of SfDataGrid. |
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 |
---|---|
System.Windows.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 |
---|---|
System.Windows.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 |
---|---|
System.Windows.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 |
---|---|
System.Windows.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 |
---|---|
System.Windows.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 |
---|---|
System.Windows.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. |
OnDrawCheckBox(DrawingContext, RowInfo, CellInfo, GridColumn)
Draws the CheckBox cell for the specified drawingContext, row info ,cell info and column to page panel element.
Declaration
protected virtual void OnDrawCheckBox(DrawingContext drawingContext, RowInfo rowInfo, CellInfo cellInfo, GridColumn Column)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | drawingContext | The corresponding drawingContext to draw the CheckBox cell. |
RowInfo | rowInfo | The corresponding rowInfo to draw the CheckBox cell. |
CellInfo | cellInfo | The corresponding cellInfo to draw the CheckBox cell. |
GridColumn | Column | The corresponding column to draw the CheckBox cell. |
OnDrawImage(DrawingContext, RowInfo, CellInfo, Image)
Draws the image cell for the specified drawing context, row info, cell info and image.
Declaration
protected virtual void OnDrawImage(DrawingContext drawingContext, RowInfo rowInfo, CellInfo cellInfo, Image image)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | drawingContext | The corresponding drawing context to draw the image cell. |
RowInfo | rowInfo | The corresponding row info to draw the image cell. |
CellInfo | cellInfo | The corresponding cell info to draw the image cell. |
System.Windows.Controls.Image | image | The corresponding image to draw. |
OnDrawText(DrawingContext, RowInfo, CellInfo, String)
Draws the text for the specified drawing context, row info, cell info and cell value.
Declaration
protected virtual void OnDrawText(DrawingContext drawingContext, RowInfo rowInfo, CellInfo cellInfo, string cellValue)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | drawingContext | The corresponding drawing context to draw the text. |
RowInfo | rowInfo | The corresponding row info to draw the text. |
CellInfo | cellInfo | The corresponding cell info to draw the text. |
System.String | cellValue | The corresponding cell value to draw the text. |
OnRender(DrawingContext, List<RowInfo>)
Draws the content of the specified drawingContext and list of row infos to page panel element.
Declaration
public void OnRender(DrawingContext drawingContext, List<RowInfo> rowsInfoList)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | drawingContext | The corresponding drawingContext to draw. |
System.Collections.Generic.List<RowInfo> | rowsInfoList | The list of row infos to draw. |
OnRenderCell(DrawingContext, RowInfo, CellInfo)
Draws the content of each cell value and its border for the specified drawingContext, row info and cell info to page panel element.
Declaration
protected virtual void OnRenderCell(DrawingContext drawingContext, RowInfo rowInfo, CellInfo cellInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | drawingContext | The corresponding drawingContext to draw each cell content. |
RowInfo | rowInfo | The corresponding row info to draw each cell content. |
CellInfo | cellInfo | The corresponding cell info to draw each cell content. |
OnRenderRow(DrawingContext, RowInfo)
Draws the content of each row for the specified drawingContext and list of row infos to page panel element.
Declaration
protected virtual void OnRenderRow(DrawingContext drawingContext, RowInfo rowInfoList)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | drawingContext | The corresponding drawingContext to draw the row info. |
RowInfo | rowInfoList |
Print()
Prints the content of SfDataGrid.
Declaration
public void Print()
Print(PrintDialog)
Prints the content of SfDataGrid according to the print ticket and print queue configurations in the print dialog.
Declaration
public void Print(PrintDialog printDialog)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Controls.PrintDialog | printDialog | Configures the PrintTicket and PrintQueue according to the user input for printing. |
Print(PrintDialog, Nullable<Boolean>)
Prints the content of SfDataGrid according to the print ticket and print queue configures in the print dialog.
Declaration
protected virtual void Print(PrintDialog printDialog, Nullable<bool> canPrint)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Controls.PrintDialog | printDialog | Configures the PrintTicket and PrintQueue according to the user input for printing. |
System.Nullable<System.Boolean> | canPrint | Decides whether the print can be performed or not. |
PrintWithDialog()
Prints the content of the DataGrid using the standard System.Windows.Controls.PrintDialog.
Declaration
protected virtual void PrintWithDialog()
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 |