WinForms

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

    Show / Hide Table of Contents

    Class SpreadsheetColumn

    Holds and updates the information about the properties of each and every cell which are in view.

    Inheritance
    System.Object
    NonFinalizeDisposable
    Disposable
    GridColumn
    SpreadsheetColumn
    Implements
    System.IDisposable
    IColumnElement
    Inherited Members
    GridColumn.Width
    GridColumn.Height
    GridColumn.GetColumnWidth()
    GridColumn.GetRowHeight()
    GridColumn.UpdateBorderStyle(Int32, Int32, Pen, Boolean)
    GridColumn.UpdateColumn()
    GridColumn.IsDirty
    GridColumn.IsBordersDirty
    GridColumn.IsSpannedColum
    GridColumn.CoveredCellInfo
    GridColumn.IsEditing
    GridColumn.CellRowColumnIndex
    GridColumn.DisplayText
    GridColumn.IsFloatingCell
    GridColumn.IsFloodCell
    GridColumn.RowIndex
    GridColumn.ColumnIndex
    GridColumn.IsEnsured
    GridColumn.ColumnRegion
    GridColumn.IsVisible
    NonFinalizeDisposable.Dispose()
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Windows.Forms.Spreadsheet
    Assembly: Syncfusion.Spreadsheet.Windows.dll
    Syntax
    public class SpreadsheetColumn : GridColumn, IDisposable, IColumnElement

    Constructors

    SpreadsheetColumn(SpreadsheetGrid)

    Initializes a new instance of the SpreadsheetColumn class.

    Declaration
    public SpreadsheetColumn(SpreadsheetGrid grid)
    Parameters
    Type Name Description
    SpreadsheetGrid grid

    An instance of SpreadsheetGrid

    Properties

    Element

    Gets or sets the Element

    Declaration
    public Control Element { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.Control

    ExcelRange

    Gets or sets the appropriate IRange.

    Declaration
    public IRange ExcelRange { get; set; }
    Property Value
    Type Description
    IRange

    ExcelStyle

    Gets or set the appropriate ExcelStyle which might be modified based on conditional formats, table formats, etc.

    Declaration
    public IStyle ExcelStyle { get; set; }
    Property Value
    Type Description
    IStyle

    Renderer

    Gets or sets the instance of ISpreadsheetCellRenderer which provides the functionality of cell renderers.

    Declaration
    public ISpreadsheetCellRenderer Renderer { get; set; }
    Property Value
    Type Description
    ISpreadsheetCellRenderer

    An instance of ISpreadsheetCellRenderer.

    Methods

    Dispose(Boolean)

    Releases the unmanaged resources used by the SpreadsheetColumn and optionally releases the managed resources.

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

    If set to true, to release both managed and unmanaged resources; false to release only unmanaged resources.

    Overrides
    GridColumn.Dispose(Boolean)

    EnsureFloatingCellSize(List<GridColumn>, Size, Int32)

    Calculates the size for floating cell and display text in the cell.

    Declaration
    protected override void EnsureFloatingCellSize(List<GridColumn> elements, Size cellSize, int arrayIndex)
    Parameters
    Type Name Description
    System.Collections.Generic.List<GridColumn> elements

    List of cell elements which are in view.

    System.Drawing.Size cellSize

    Current size of the cell.

    System.Int32 arrayIndex

    Index of the visible columns.

    Overrides
    GridColumn.EnsureFloatingCellSize(List<GridColumn>, Size, Int32)

    EnsureFloatingCellSizeOnEdit(String)

    Calculate the floating cell size on editing.

    Declaration
    protected override void EnsureFloatingCellSizeOnEdit(string text)
    Parameters
    Type Name Description
    System.String text

    Display text in the cell.

    Overrides
    GridColumn.EnsureFloatingCellSizeOnEdit(String)

    GetCurrentCellRendererElement()

    Used to get the edit UI element of current cell.

    Declaration
    protected override Control GetCurrentCellRendererElement()
    Returns
    Type Description
    System.Windows.Forms.Control

    An UI element.

    Overrides
    GridColumn.GetCurrentCellRendererElement()

    GetDisplayTextSize(String, Size, Boolean)

    Calculate the display text size with help of MeasureText() based on cellsize and FloatingCellSize if FloatingCellSize is not an empty.

    Declaration
    protected override Size GetDisplayTextSize(string text, Size cellSize, bool wrapText)
    Parameters
    Type Name Description
    System.String text

    Display text.

    System.Drawing.Size cellSize

    Size of the cell.

    System.Boolean wrapText

    true if textwrapping is applied; else false.

    Returns
    Type Description
    System.Drawing.Size

    Size of the object.

    Overrides
    GridColumn.GetDisplayTextSize(String, Size, Boolean)

    GetTextAlignment()

    Gets the HorizontalAlignment of the cell.

    Declaration
    protected override HorizontalAlignment GetTextAlignment()
    Returns
    Type Description
    System.Windows.Forms.HorizontalAlignment

    HorizontalAlignment.

    Overrides
    GridColumn.GetTextAlignment()

    GetTextWrapping()

    Determines if the text is wrapped or not.

    Declaration
    protected override bool GetTextWrapping()
    Returns
    Type Description
    System.Boolean

    Returns true, if text is wrapped; otherwise false.

    Overrides
    GridColumn.GetTextWrapping()

    OnRender(SpreadsheetPaint, Rectangle, Rectangle, Boolean, Boolean)

    Declaration
    protected override void OnRender(SpreadsheetPaint paint, Rectangle cellRect, Rectangle clipRect, bool drawGridLines = true, bool adjustBackgroundRect = false)
    Parameters
    Type Name Description
    SpreadsheetPaint paint
    System.Drawing.Rectangle cellRect
    System.Drawing.Rectangle clipRect
    System.Boolean drawGridLines
    System.Boolean adjustBackgroundRect
    Overrides
    GridColumn.OnRender(SpreadsheetPaint, Rectangle, Rectangle, Boolean, Boolean)

    OnRenderBackground(SpreadsheetPaint, Rectangle)

    Render the cell background.

    Declaration
    protected override void OnRenderBackground(SpreadsheetPaint paint, Rectangle cellRect)
    Parameters
    Type Name Description
    SpreadsheetPaint paint

    SpreadsheetPaint object

    System.Drawing.Rectangle cellRect

    Cell rect

    Overrides
    GridColumn.OnRenderBackground(SpreadsheetPaint, Rectangle)

    OnUpdateColumn()

    Update the column properties such as renderer, cell type, style info, row index, column index, cell element etc.

    Declaration
    protected override void OnUpdateColumn()
    Overrides
    GridColumn.OnUpdateColumn()

    SetTextWrapping(Boolean)

    Set and reset the text wrapping while editing in floating cell.

    Declaration
    protected override void SetTextWrapping(bool setWrapText)
    Parameters
    Type Name Description
    System.Boolean setWrapText

    True or False.

    Overrides
    GridColumn.SetTextWrapping(Boolean)

    UpdateCellBorders()

    Updates the cell borders for the .

    Declaration
    protected override void UpdateCellBorders()
    Overrides
    GridColumn.UpdateCellBorders()

    UpdateFloatingCellBorders()

    Update the borders for floating cells.

    Declaration
    protected override void UpdateFloatingCellBorders()
    Overrides
    GridColumn.UpdateFloatingCellBorders()

    Implements

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