WinForms

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridExcelConverterControl

    Show / Hide Table of Contents

    Class GridExcelConverterControl

    GridExcelConverterControl class provides support for Exporting data from a gridControl into an Excel spreadsheet for verification and/or computation. This Control automatically Copies the Grid's Styles, Formats to Excel. The GridExcelConverter Control is derived from GridExcelConverterBase.

    Inheritance
    System.Object
    GridExcelConverterBase
    GridExcelConverterControl
    Inherited Members
    GridExcelConverterBase.DEF_GENERAL_FORMAT
    GridExcelConverterBase.DEF_NUMBER_FORMAT
    GridExcelConverterBase.DEF_EXCEL_GENERAL_FORMAT
    GridExcelConverterBase.DEF_EXCEL_CURRENCY_FORMAT
    GridExcelConverterBase.DEF_EXCEL_DECIMAL_FORMAT
    GridExcelConverterBase.DEF_EXCEL_SCIENTIFIC_FORMAT
    GridExcelConverterBase.DEF_EXCEL_FIXEDPOINT_FORMAT
    GridExcelConverterBase.DEF_EXCEL_NUMBER_FORMAT
    GridExcelConverterBase.DEF_EXCEL_PERCENT_FORMAT
    GridExcelConverterBase.DEF_EXCEL_DATE_FORMAT
    GridExcelConverterBase.DEF_EXCEL_HEX_FORMAT
    GridExcelConverterBase.DEF_MAX_COLUMN_ZERO_INDEX
    GridExcelConverterBase.DEF_MAX_COLUMN_ONE_INDEX
    GridExcelConverterBase.DEF_MAX_ROW_ZERO_INDEX
    GridExcelConverterBase.DEF_MAX_ROW_ONE_INDEX
    GridExcelConverterBase.DEF_EXCEL2007_MAX_COLUMN_COUNT
    GridExcelConverterBase.DEF_EXCEL2007_MAX_ROW_COUNT
    GridExcelConverterBase.DEF_CHAR_CURRENCY
    GridExcelConverterBase.DEF_CHAR_DATE
    GridExcelConverterBase.DEF_CHAR_SCIENTIFIC
    GridExcelConverterBase.DEF_CHAR_FIXEDPOINT
    GridExcelConverterBase.DEF_CHAR_GENERAL
    GridExcelConverterBase.DEF_CHAR_NUMBER
    GridExcelConverterBase.DEF_CHAR_PERCENT
    GridExcelConverterBase.DEF_CHAR_HEX
    GridExcelConverterBase.DEF_DEFAULT_HALIGNMENT
    GridExcelConverterBase.DEF_DEFAULT_VALIGNMENT
    GridExcelConverterBase.DEF_RIGHT_ANGLE
    GridExcelConverterBase.DEF_MAXIMUM_ANGLE
    GridExcelConverterBase.DEF_MINIMUM_SUPPORTED_ANGLE
    GridExcelConverterBase.DEF_EXCEL_NUMBER_FORMATS
    GridExcelConverterBase.PatternStyleToExcelPattern
    GridExcelConverterBase.hasHeaderBKColor
    GridExcelConverterBase.hasForeColor
    GridExcelConverterBase.CreateEngine()
    GridExcelConverterBase.ExportStylesToExcel(GridModel, Int32, Int32, IRange)
    GridExcelConverterBase.ExportStylesToExcel(GridModel, Int32, Int32, GridStyleInfo, IRange)
    GridExcelConverterBase.ExportStylesToExcel(GridStyleInfo, IRange)
    GridExcelConverterBase.ExportNumberFormatToExcel(GridStyleInfo, IRange)
    GridExcelConverterBase.ExportBrushToExcel(GridStyleInfo, IRange)
    GridExcelConverterBase.ExportFontToExcel(GridStyleInfo, IRange)
    GridExcelConverterBase.ExportBordersToExcel(GridStyleInfo, IRange)
    GridExcelConverterBase.ExportAlignmentToExcel(GridStyleInfo, IRange)
    GridExcelConverterBase.ExportBordersToExcel(GridBorder, IBorder)
    GridExcelConverterBase.CombineStyles(GridStyleInfo, GridStyleInfo)
    GridExcelConverterBase.RaiseQueryImportExportCellInfo(GridImportExportCellInfoEventArgs)
    GridExcelConverterBase.ExportImageToExcel(Image, IRange)
    GridExcelConverterBase.ExportImageToExcel(GridStyleInfo, IRange)
    GridExcelConverterBase.UseDefaultAlignment
    GridExcelConverterBase.HeaderBackColor
    GridExcelConverterBase.ExportBorders
    GridExcelConverterBase.ExportStyle
    GridExcelConverterBase.IsGroupingGrid
    GridExcelConverterBase.Grid
    GridExcelConverterBase.ExportImage
    GridExcelConverterBase.QueryImportExportCellInfo
    Namespace: Syncfusion.GridExcelConverter
    Assembly: Syncfusion.GridConverter.Windows.dll
    Syntax
    public class GridExcelConverterControl : GridExcelConverterBase

    Constructors

    GridExcelConverterControl()

    Initializes a new instance of the GridExcelConverterControl class.

    Declaration
    public GridExcelConverterControl()

    Fields

    SkipMergeCellCheckOnSetBorders

    After v6.1 ExcelToGrid Conversion will check for Merged cells when importing borders. When there is no merged cells this can be set to true to avoid checking for MergeCells on importing borders from excel cells.

    Default value is false.

    Declaration
    public static bool SkipMergeCellCheckOnSetBorders
    Field Value
    Type Description
    System.Boolean

    Properties

    AutoFitColumns

    Gets or sets a value Indicating whether converter should auto fit the columns.

    Declaration
    public bool AutoFitColumns { get; set; }
    Property Value
    Type Description
    System.Boolean

    AutoFitRows

    Gets or sets a value Indicating whether converter should auto fit the rows.

    Declaration
    public bool AutoFitRows { get; set; }
    Property Value
    Type Description
    System.Boolean

    CanExportChoiceList

    Gets or set a value indicating whether grid cell's combobox has to be exported as Excel sheet's DataValidation dropdown list.

    Declaration
    public bool CanExportChoiceList { get; set; }
    Property Value
    Type Description
    System.Boolean

    CanExportColumnWidth

    Gets or sets a value indicating whether grid's column width has to be exported to Excel. If you want to disable this column width, you can set False and assign your needed RowHeight in DefaultRowHeight property.

    Declaration
    public bool CanExportColumnWidth { get; set; }
    Property Value
    Type Description
    System.Boolean

    CanExportRowHeight

    Gets or sets a value indicating whether grid's row height has to be exported to Excel. If you want to disable this row height, you can set False and assign your needed RowHeight in DefaultRowHeight property.

    Declaration
    public bool CanExportRowHeight { get; set; }
    Property Value
    Type Description
    System.Boolean

    DefaultColumnWidth

    Gets or sets the default column width in Excel sheet for all columns. This is applicable when disabling CanExportColumnWidth and AutoFitColumns.

    Declaration
    public int DefaultColumnWidth { get; set; }
    Property Value
    Type Description
    System.Int32

    DefaultRowHeight

    Gets or sets the default row height in Excel sheet for all rows. This is applicable when disabling CanExportRowHeight and AutoFitRows.

    Declaration
    public int DefaultRowHeight { get; set; }
    Property Value
    Type Description
    System.Int32

    ExcelVersion

    Gets or sets the excel sheet's default version.

    Declaration
    public ExcelVersion ExcelVersion { get; set; }
    Property Value
    Type Description
    ExcelVersion

    ExportHiddenColumnsMode

    Gets or sets the mode for exporting the hidden columns with various options.

    Declaration
    public GridExcelConverterControl.ExportHiddenColumns ExportHiddenColumnsMode { get; set; }
    Property Value
    Type Description
    GridExcelConverterControl.ExportHiddenColumns

    ExportHiddenRowsMode

    Gets or sets the mode for exporting the hidden columns with various options.

    Declaration
    public GridExcelConverterControl.ExportHiddenRows ExportHiddenRowsMode { get; set; }
    Property Value
    Type Description
    GridExcelConverterControl.ExportHiddenRows

    ImportBorders

    Gets or sets a value indicating whether the borders has to be imported.

    Declaration
    public bool ImportBorders { get; set; }
    Property Value
    Type Description
    System.Boolean

    ImportStyles

    Gets or sets a value indicating whether the styles like fonts, borders, alignment, and so on has to be imported.

    Declaration
    public bool ImportStyles { get; set; }
    Property Value
    Type Description
    System.Boolean

    MessageStrings

    Gets a string array that holds strings used with MessageBoxes that display error conditions.

    Declaration
    public string[] MessageStrings { get; }
    Property Value
    Type Description
    System.String[]

    ShowGridLines

    Gets or sets a value indicating whether gridlines has to be shown in Excel sheet.

    Declaration
    public bool ShowGridLines { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    AddCustomFunction(String, String, IWorkbook)

    Adds the custom function in excel work book while exporting

    Declaration
    public void AddCustomFunction(string xlafile, string functionName, IWorkbook book)
    Parameters
    Type Name Description
    System.String xlafile

    file path of the user define function.

    System.String functionName

    Function name of user define function

    IWorkbook book

    excel work book which is used for exporting

    AddCustomFunction(String, String, String)

    Adds the custom function in excel file while exporting

    Declaration
    public void AddCustomFunction(string xlafile, string functionName, string excelfile)
    Parameters
    Type Name Description
    System.String xlafile

    file path of the user define function.

    System.String functionName

    Function name of user define function

    System.String excelfile

    file name of excel book

    ConvertExcelRangeToGrid(IRange, GridModel)

    Converts the Excel range to grid model.

    Declaration
    public virtual void ConvertExcelRangeToGrid(IRange rangeToConvert, GridModel grid)
    Parameters
    Type Name Description
    IRange rangeToConvert

    The IRange to import.

    GridModel grid

    The destination GridModel.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If rangeToConvert or grid is null.

    ConvertExcelStyleToVirtualGridStyle(GridStyleInfo, IWorksheet, IRange)

    Converts the excel range to virtual grid.

    Declaration
    public void ConvertExcelStyleToVirtualGridStyle(GridStyleInfo cell, IWorksheet sheet, IRange rangeToConvert)
    Parameters
    Type Name Description
    GridStyleInfo cell

    The destination grid cell.

    IWorksheet sheet

    The IWorksheet.

    IRange rangeToConvert

    The IRange.

    Remarks

    This method can be used in QueryCellInfo event to convert the Excel range to Grid cell as virtual mode.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If rangeToConvert or cell is null.

    Dispose(Boolean)

    Releases the unmanaged resources used by the System.ComponentModel.Component and optionally releases the managed resources.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    ExcelToGrid(IWorkbook)

    Imports the Excel workbook into array of grid models.

    Declaration
    public GridModel[] ExcelToGrid(IWorkbook book)
    Parameters
    Type Name Description
    IWorkbook book

    Source workbook to convert.

    Returns
    Type Description
    GridModel[]

    Corresponding grid models.

    ExcelToGrid(IWorksheet, GridModel)

    Imports the data from excel worksheet into grid.

    Declaration
    public void ExcelToGrid(IWorksheet sheet, GridModel grid)
    Parameters
    Type Name Description
    IWorksheet sheet

    The Excel Worksheet.

    GridModel grid

    The destination GridModel.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If grid or sheet is null.

    ExcelToGrid(String)

    Imports the excel file into array of grid models.

    Declaration
    public GridModel[] ExcelToGrid(string strFileName)
    Parameters
    Type Name Description
    System.String strFileName

    The name of the excel file to import.

    Returns
    Type Description
    GridModel[]

    Corresponding grid models.

    Exceptions
    Type Condition
    System.ArgumentNullException

    if strFileName is null.

    System.ArgumentException

    if strFileName length is 0.

    ExcelToGrid(String, IndexRange[], GridModel[])

    Imports the excel workbook into array of grid models.

    Declaration
    public void ExcelToGrid(string strFileName, IndexRange[] arrRanges, GridModel[] arrModels)
    Parameters
    Type Name Description
    System.String strFileName

    The name of the excel file to import.

    Syncfusion.GridExcelConverter.IndexRange[] arrRanges

    Array of worksheet ranges to convert.

    GridModel[] arrModels

    Array of GridModels to convert into.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If any of the parameters such as strFileName,arrModels,arrRanges are null.

    System.ArgumentException

    If strFileName length is 0.

    ExcelToGrid(String, GridModel)

    Imports the excel file to GridControl.

    Declaration
    public void ExcelToGrid(string strFileName, GridModel grid)
    Parameters
    Type Name Description
    System.String strFileName

    The name of the excel file to import.

    GridModel grid

    The destination GridModel.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If strFileName or grid is null.

    System.ArgumentNullException

    If strFileNamelength is 0.

    ExcelToGrid(String, Int32[], GridModel[])

    Imports the excel workbook into array of grid models.

    Declaration
    public void ExcelToGrid(string strFileName, int[] arrIndexes, GridModel[] arrModels)
    Parameters
    Type Name Description
    System.String strFileName

    The name of the excel file to import.

    System.Int32[] arrIndexes

    Worksheet's indexes to convert.

    GridModel[] arrModels

    Array of grid models to convert into.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If any of the parameters such as strFileName,arrModels,arrIndexes is null.

    System.ArgumentException

    If strFileName length is 0. If arrIndexes length is less than arrModels length.

    ExcelToVirtualGrid(GridModel, IWorksheet)

    Imports the single sheet from excel to virtual grid.

    Declaration
    public void ExcelToVirtualGrid(GridModel grid, IWorksheet sheet)
    Parameters
    Type Name Description
    GridModel grid

    The destination GridModel.

    IWorksheet sheet

    The source IWorksheet.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If grid or sheet is null.

    ExcelToVirtualGrid(IWorkbook)

    Imports the entire workbook from excel to virtual grid.

    Declaration
    public GridModel[] ExcelToVirtualGrid(IWorkbook book)
    Parameters
    Type Name Description
    IWorkbook book

    The book.

    Returns
    Type Description
    GridModel[]

    Array of GridModel

    Exceptions
    Type Condition
    System.ArgumentNullException

    if book is null.

    ExcelToVirtualGrid(String)

    Imports the excel sheets from the specified Excel file.

    Declaration
    public GridModel[] ExcelToVirtualGrid(string fileName)
    Parameters
    Type Name Description
    System.String fileName

    The Excel sheet location.

    Returns
    Type Description
    GridModel[]

    The GridModel collection.

    Exceptions
    Type Condition
    System.ArgumentNullException

    if fileName is null.

    System.ArgumentException

    if fileName length is 0.

    ExcelToVirtualGrid(String, GridModel)

    Imports the first Excel sheet alone from specified Excel file.

    Declaration
    public void ExcelToVirtualGrid(string fileName, GridModel gridModel)
    Parameters
    Type Name Description
    System.String fileName

    The Excel file location.

    GridModel gridModel

    The GridModel to import the Excel sheet.

    Exceptions
    Type Condition
    System.ArgumentNullException

    if fileName or gridModelis null.

    System.ArgumentException

    if fileName length is 0.

    ExportCellToExcel(GridStyleInfo, IRange)

    Exports the cell data from grid to Excel.

    Declaration
    protected virtual void ExportCellToExcel(GridStyleInfo gridCell, IRange range)
    Parameters
    Type Name Description
    GridStyleInfo gridCell

    The GridStyleInfo.

    IRange range

    Destination Excel range.

    ExportColumnWidthsToExcel(GridModel, IWorksheet, Int32, Int32)

    Exports the column widths to Excel.

    Declaration
    protected virtual void ExportColumnWidthsToExcel(GridModel grid, IWorksheet sheet, int gridColumnIndex, int excelColumnIndex)
    Parameters
    Type Name Description
    GridModel grid

    The grid model that needs to be exported.

    IWorksheet sheet

    The destination IWorksheet.

    System.Int32 gridColumnIndex

    The column index of the excel sheet.

    System.Int32 excelColumnIndex

    Indicates the column delta value. i.e If column headers are exporting it will be 1 other wise 0.

    ExportRange(GridRangeInfo, GridModel, IWorksheet, ConverterOptions)

    Exports the specified range to excel from GridModel to Excel.

    Declaration
    public void ExportRange(GridRangeInfo range, GridModel model, IWorksheet sheet, ConverterOptions options)
    Parameters
    Type Name Description
    GridRangeInfo range

    The Range of type GridRangeInfo to be exported.

    GridModel model

    The grid model.

    IWorksheet sheet

    Excel sheet to which data is to be exported.

    ConverterOptions options

    The converter options.

    ExportRange(GridRangeInfo, GridModel, String, ConverterOptions)

    Exports the specified range to excel from GridModel to Excel.

    Declaration
    public void ExportRange(GridRangeInfo range, GridModel model, string FileName, ConverterOptions options)
    Parameters
    Type Name Description
    GridRangeInfo range

    Range of type GridRangeInfo to be exported.

    GridModel model

    The grid model.

    System.String FileName

    Name of the file to which the grid is to be exported.

    ConverterOptions options

    The converter options.

    ExportRowHeightToExcel(GridModel, IWorksheet, Int32, Int32)

    Exports the row heights to Excel.

    Declaration
    protected virtual void ExportRowHeightToExcel(GridModel grid, IWorksheet sheet, int gridRowIndex, int excelRowIndex)
    Parameters
    Type Name Description
    GridModel grid

    The grid model that needs to be exported.

    IWorksheet sheet

    The destination IWorksheet.

    System.Int32 gridRowIndex

    The grid row index of the excel sheet.

    System.Int32 excelRowIndex

    The Excel sheet's row index to set the column width.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If grid or sheet is null.

    GridCellToExcel(GridModel, Int32, Int32, IRange)

    Exports the grid cell to excel cell.

    Declaration
    public virtual void GridCellToExcel(GridModel grid, int iRow, int iColumn, IRange range)
    Parameters
    Type Name Description
    GridModel grid

    Source grid.

    System.Int32 iRow

    The row index of the grid.

    System.Int32 iColumn

    The column index of the grid.

    IRange range

    The destination IRange.

    GridToExcel(GridControl, IWorksheet)

    Exports grid into excel file.

    Declaration
    public void GridToExcel(GridControl grid, IWorksheet sheet)
    Parameters
    Type Name Description
    GridControl grid

    The GridControl to export.

    IWorksheet sheet

    The destination IWorksheet.

    GridToExcel(GridControl, IWorksheet, ConverterOptions)

    Exports grid into excel file.

    Declaration
    public void GridToExcel(GridControl grid, IWorksheet sheet, ConverterOptions options)
    Parameters
    Type Name Description
    GridControl grid

    The GridControl to export.

    IWorksheet sheet

    The destination IWorksheet.

    ConverterOptions options

    The Converter options.

    GridToExcel(GridControl, String)

    Exports grid into excel file.

    Declaration
    public void GridToExcel(GridControl grid, string fileName)
    Parameters
    Type Name Description
    GridControl grid

    The GridControl to export.

    System.String fileName

    The destination Excel sheet's file name.

    GridToExcel(GridControl, String, ConverterOptions)

    Exports grid into excel file.

    Declaration
    public void GridToExcel(GridControl grid, string fileName, ConverterOptions options)
    Parameters
    Type Name Description
    GridControl grid

    The GridControl to export.

    System.String fileName

    The destination Excel sheet's file name.

    ConverterOptions options

    Converter options.

    GridToExcel(GridModel, IWorksheet)

    Exports grid into excel worksheet.

    Declaration
    public void GridToExcel(GridModel grid, IWorksheet sheet)
    Parameters
    Type Name Description
    GridModel grid

    The GridModel to export.

    IWorksheet sheet

    The destination IWorksheet.

    GridToExcel(GridModel, IWorksheet, ConverterOptions)

    Exports grid into excel worksheet.

    Declaration
    public void GridToExcel(GridModel grid, IWorksheet sheet, ConverterOptions options)
    Parameters
    Type Name Description
    GridModel grid

    The GridModel to export.

    IWorksheet sheet

    The destination IWorksheet.

    ConverterOptions options

    Converter options.

    GridToExcel(GridModel, String)

    Exports grid into excel file.

    Declaration
    public void GridToExcel(GridModel grid, string fileName)
    Parameters
    Type Name Description
    GridModel grid

    The GridModel to export.

    System.String fileName

    The destination Excel sheet's file name.

    GridToExcel(GridModel, String, ConverterOptions)

    Exports grid into excel file.

    Declaration
    public void GridToExcel(GridModel grid, string fileName, ConverterOptions options)
    Parameters
    Type Name Description
    GridModel grid

    The GridModel to export.

    System.String fileName

    The destination Excel sheet's file name.

    ConverterOptions options

    Converter options.

    ImportAlignment(IStyle, GridStyleInfo)

    Sets alignment of the GridStyleInfo.

    Declaration
    protected virtual void ImportAlignment(IStyle excelStyle, GridStyleInfo cell)
    Parameters
    Type Name Description
    IStyle excelStyle

    Excel style to get alignment block from.

    GridStyleInfo cell

    GridStyleInfo to set alignment block in.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If any of the parameters such as excelStyle,cell are null.

    ImportBordersToGrid(IStyle, GridStyleInfo)

    Imports the excel style borders to Grid cells (for normal excel importing).

    Declaration
    protected virtual void ImportBordersToGrid(IStyle excelStyle, GridStyleInfo cell)
    Parameters
    Type Name Description
    IStyle excelStyle

    The source Excel cell style.

    GridStyleInfo cell

    The destination cell.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If any of the parameters such as excelStyle,cell are null.

    ImportBordersToVirtualGrid(IRange, GridStyleInfo, IWorksheet)

    Sets grid cell borders based on excel style. This is specifically used for Virtual Grid.

    Declaration
    protected virtual void ImportBordersToVirtualGrid(IRange range, GridStyleInfo cell, IWorksheet sheet)
    Parameters
    Type Name Description
    IRange range

    The source Excel cell style.

    GridStyleInfo cell

    The destination grid cell.

    IWorksheet sheet

    The source Excel work sheet.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If any of the parameters such as range,cell are null.

    ImportCellStyleToGrid(IStyle, GridStyleInfo)

    Imports the excel style into GridControl.

    Declaration
    protected void ImportCellStyleToGrid(IStyle excelStyle, GridStyleInfo cell)
    Parameters
    Type Name Description
    IStyle excelStyle

    The source Excel sheet range.

    GridStyleInfo cell

    The destination grid cell.

    ImportCellStyleToVirtualGrid(IRange, GridStyleInfo, IWorksheet)

    Imports the grid cell style based on excel style for Virtual GridControl.

    Declaration
    protected virtual void ImportCellStyleToVirtualGrid(IRange range, GridStyleInfo cell, IWorksheet sheet)
    Parameters
    Type Name Description
    IRange range

    The source Excel sheet range.

    GridStyleInfo cell

    The destination grid cell.

    IWorksheet sheet

    The Excel sheet.

    Exceptions
    Type Condition
    System.ArgumentNullException

    if any of the parameters such as range,sheet,cell are null.

    ImportColumnWidthToGrid(IWorksheet, GridModel)

    Imports the column width information from excel worksheet into grid.

    Declaration
    protected virtual void ImportColumnWidthToGrid(IWorksheet sheet, GridModel grid)
    Parameters
    Type Name Description
    IWorksheet sheet

    The source Excel sheet.

    GridModel grid

    The destination GridModel.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If any of the parameters such as grid,sheet are null.

    ImportComboxToGrid(IWorksheet, GridModel)

    Imports the combobox from excel worksheet into grid.

    Declaration
    protected virtual void ImportComboxToGrid(IWorksheet sheet, GridModel grid)
    Parameters
    Type Name Description
    IWorksheet sheet

    The source Excel sheet.

    GridModel grid

    The destination GridModel.

    ImportFontToGrid(IStyle, GridStyleInfo)

    Imports the font for the cell based on ExcelRW style.

    Declaration
    protected virtual void ImportFontToGrid(IStyle excelStyle, GridStyleInfo cell)
    Parameters
    Type Name Description
    IStyle excelStyle

    ExcelRW style to get font setting from.

    GridStyleInfo cell

    Cell style to set font.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If any of the parameters such as excelStyle,cell are null.

    ImportFreezePanesToGrid(IWorksheet, GridModel)

    Imports the freeze panes from excel worksheet into grid.

    Declaration
    protected virtual void ImportFreezePanesToGrid(IWorksheet sheet, GridModel grid)
    Parameters
    Type Name Description
    IWorksheet sheet

    The source Excel sheet.

    GridModel grid

    The destination GridModel.

    ImportGridLinesToGrid(IWorksheet, GridModel)

    Imports the grid line visibility to grid.

    Declaration
    protected virtual void ImportGridLinesToGrid(IWorksheet worksheet, GridModel gridModel)
    Parameters
    Type Name Description
    IWorksheet worksheet

    The source Excel sheet.

    GridModel gridModel

    The destination GridModel.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If any of the parameters such as gridModel,worksheet are null.

    ImportHyperlinkToGrid(IWorksheet, IRange, GridStyleInfo)

    Imports the hyperlink to normal grid.

    Declaration
    protected virtual void ImportHyperlinkToGrid(IWorksheet sheet, IRange excelrange, GridStyleInfo cell)
    Parameters
    Type Name Description
    IWorksheet sheet

    The source Excel sheet.

    IRange excelrange

    The source Excel cell range.

    GridStyleInfo cell

    The destination grid cell.

    ImportImagesToGrid(IWorksheet, GridModel)

    Imports the images from Excel sheet.

    Declaration
    protected virtual void ImportImagesToGrid(IWorksheet sheet, GridModel grid)
    Parameters
    Type Name Description
    IWorksheet sheet

    The source Excel sheet.

    GridModel grid

    The destination GridModel.

    ImportMergesToGrid(IWorksheet, GridModel)

    Imports the merged ranges into grid.

    Declaration
    protected virtual void ImportMergesToGrid(IWorksheet sheet, GridModel grid)
    Parameters
    Type Name Description
    IWorksheet sheet

    The source Excel sheet.

    GridModel grid

    The destination GridModel.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If any of the parameters such as grid,sheet are null.

    ImportNamedRangesToGrid(IWorksheet, GridModel)

    Copies the named range from excel worksheet into grid.

    Declaration
    protected virtual void ImportNamedRangesToGrid(IWorksheet sheet, GridModel grid)
    Parameters
    Type Name Description
    IWorksheet sheet

    The source Excel sheet.

    GridModel grid

    The destination GridModel.

    ImportNumberFormatToGrid(IStyle, GridStyleInfo)

    Imports the number format from excel style into grid cell.

    Declaration
    protected virtual void ImportNumberFormatToGrid(IStyle excelStyle, GridStyleInfo cell)
    Parameters
    Type Name Description
    IStyle excelStyle

    The source Excel cell style.

    GridStyleInfo cell

    The destination cell.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If any of the parameters such as excelStyle,cell are null.

    ImportOrientationToGrid(IStyle, GridStyleInfo)

    Imports the orientation settings from excel style into grid cell.

    Declaration
    protected virtual void ImportOrientationToGrid(IStyle excelStyle, GridStyleInfo cell)
    Parameters
    Type Name Description
    IStyle excelStyle

    The source cell style.

    GridStyleInfo cell

    The destination grid cell.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If any of the parameters such as excelStyle,cell are null.

    ImportRowHeightToGrid(IWorksheet, GridModel)

    Imports the row height information from excel worksheet into grid.

    Declaration
    protected virtual void ImportRowHeightToGrid(IWorksheet sheet, GridModel grid)
    Parameters
    Type Name Description
    IWorksheet sheet

    The source Excel sheet.

    GridModel grid

    The destination GridModel.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If any of the parameters such as grid,sheet are null.

    SaveCellInfoToExcelsheet(IWorksheet, GridModel, GridStyleInfo)

    Saves the changes made in grid to Excel sheet. This is mainly used for Virtual grid importing. This method can be used in SaveCellInfo event.

    Declaration
    public virtual void SaveCellInfoToExcelsheet(IWorksheet sheet, GridModel gridModel, GridStyleInfo style)
    Parameters
    Type Name Description
    IWorksheet sheet

    The destination work sheet.

    GridModel gridModel

    The virtual grid model.

    GridStyleInfo style

    The source grid cell.

    Exceptions
    Type Condition
    System.ArgumentNullException

    if any of the parameters such as gridModel,sheet,style are null.

    SelectedExport(GridModel, String, ConverterOptions)

    Exports the selected range from grid model to Excel.

    Declaration
    public void SelectedExport(GridModel model, string FileName, ConverterOptions options)
    Parameters
    Type Name Description
    GridModel model

    The grid model.

    System.String FileName

    Name of the file to which the grid is to be exported.

    ConverterOptions options

    The converter options.

    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved