GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    ExportToDataGridViewOptions Class

    Namespace:
    GemBox.Spreadsheet.WinFormsUtilities
    Assembly:
    GemBox.Spreadsheet.dll

    Represents options for exporting data from ExcelWorksheet to System.Windows.Forms.DataGridView.

    • C#
    • VB.NET
    public sealed class ExportToDataGridViewOptions
    Public NotInheritable Class ExportToDataGridViewOptions
    Inheritance:
    System.Object
    ExportToDataGridViewOptions
    Remarks

    Use default constructor to export used cell range.

    Constructors

    ExportToDataGridViewOptions()

    Initializes an instance of ExportToDataGridViewOptions class.

    • C#
    • VB.NET
    public ExportToDataGridViewOptions()
    Public Sub New
    Remarks

    Use this constructor to export used cell range.

    ExportToDataGridViewOptions(Int32, Int32, Int32, Int32)

    Initializes an instance of ExportToDataGridViewOptions class.

    • C#
    • VB.NET
    public ExportToDataGridViewOptions(int startRow, int startColumn, int numberOfRows, int numberOfColumns)
    Public Sub New(startRow As Integer, startColumn As Integer, numberOfRows As Integer, numberOfColumns As Integer)
    Parameters
    startRow
    System.Int32

    Index of the first row of data being exported from ExcelWorksheet.

    startColumn
    System.Int32

    Index of the first column of data being exported from ExcelWorksheet.

    numberOfRows
    System.Int32

    Number of rows being exported from ExcelWorksheet.

    numberOfColumns
    System.Int32

    Number of columns being exported from ExcelWorksheet.

    ExportToDataGridViewOptions(String, Int32, Int32)

    Initializes an instance of ExportToDataGridViewOptions class.

    • C#
    • VB.NET
    public ExportToDataGridViewOptions(string startCell, int numberOfRows, int numberOfColumns)
    Public Sub New(startCell As String, numberOfRows As Integer, numberOfColumns As Integer)
    Parameters
    startCell
    System.String

    Name of the first (top left) cell of data being exported from ExcelWorksheet.

    numberOfRows
    System.Int32

    Number of rows being exported from ExcelWorksheet.

    numberOfColumns
    System.Int32

    Number of columns being exported from ExcelWorksheet.

    Properties

    ColumnHeaders

    Gets or sets a value indicating whether to use first row of exported data for column headers.

    • C#
    • VB.NET
    public bool ColumnHeaders { get; set; }
    Public Property ColumnHeaders As Boolean
    Property Value
    System.Boolean

    HeaderCellPredicate

    Gets or sets a predicate that determines if the given ExcelCell is part of the header. This is useful when you don't know in which row a header has been placed.

    • C#
    • VB.NET
    public Predicate<ExcelCell> HeaderCellPredicate { get; set; }
    Public Property HeaderCellPredicate As Predicate(Of ExcelCell)
    Property Value
    System.Predicate<ExcelCell>

    HeaderRowSearchingDirection

    Gets or sets the direction in which the header row will be searched. Default value is TopToBottom

    • C#
    • VB.NET
    public SearchingDirection HeaderRowSearchingDirection { get; set; }
    Public Property HeaderRowSearchingDirection As SearchingDirection
    Property Value
    SearchingDirection

    NumberOfColumns

    Gets or sets the number of columns being exported from ExcelWorksheet.

    • C#
    • VB.NET
    public int NumberOfColumns { get; set; }
    Public Property NumberOfColumns As Integer
    Property Value
    System.Int32

    NumberOfRows

    Gets or sets the number of rows being exported from ExcelWorksheet.

    • C#
    • VB.NET
    public int NumberOfRows { get; set; }
    Public Property NumberOfRows As Integer
    Property Value
    System.Int32

    StartColumn

    Gets or sets the index of the first column of data being exported from ExcelWorksheet.

    • C#
    • VB.NET
    public int StartColumn { get; set; }
    Public Property StartColumn As Integer
    Property Value
    System.Int32

    StartRow

    Gets or sets the index of the first row of data being exported from ExcelWorksheet.

    • C#
    • VB.NET
    public int StartRow { get; set; }
    Public Property StartRow As Integer
    Property Value
    System.Int32

    Examples

    Import and Export Excel to DataGridView in C# and VB.NET
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.