menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridColumn - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class GridColumn

    Holds the information about each and every cell which are in view. It will updates the properties of cell element (GridCell) based on the styleInfo. This will triggered from GridRow when updating the cells.

    Inheritance
    System.Object
    NonFinalizeDisposable
    Disposable
    GridColumn
    SpreadsheetColumn
    Implements
    System.IDisposable
    IColumnElement
    Inherited Members
    NonFinalizeDisposable.Dispose()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Windows.Forms.CellGrid
    Assembly: Syncfusion.Spreadsheet.Windows.dll
    Syntax
    public class GridColumn : Disposable, IDisposable, IColumnElement

    Constructors

    GridColumn(SfCellGrid)

    Initializes a new instance of the GridColumn class.

    Declaration
    public GridColumn(SfCellGrid grid)
    Parameters
    Type Name Description
    SfCellGrid grid

    An instance of SfCellGrid.

    Fields

    Height

    Declaration
    protected double Height
    Field Value
    Type
    System.Double

    Width

    Declaration
    protected double Width
    Field Value
    Type
    System.Double

    Properties

    CellRowColumnIndex

    Gets the value indicating the instance of RowColumnIndex of the column.

    Declaration
    public RowColumnIndex CellRowColumnIndex { get; }
    Property Value
    Type Description
    RowColumnIndex

    An instance of RowColumnIndex.

    ColumnIndex

    Gets or sets the column index.

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

    Index of the column.

    ColumnRegion

    Gets or sets the ScrollAxisRegion of column.

    Declaration
    public ScrollAxisRegion ColumnRegion { get; set; }
    Property Value
    Type Description
    ScrollAxisRegion

    An instance of ScrollAxisRegion.

    CoveredCellInfo

    Gets the value of CoveredCellInfo if this is spanned column.

    Declaration
    public CoveredCellInfo CoveredCellInfo { get; }
    Property Value
    Type Description
    CoveredCellInfo

    An instance of CoveredCellInfo.

    DisplayText

    Gets or sets the display text.

    Declaration
    public string DisplayText { get; set; }
    Property Value
    Type Description
    System.String

    Text to be displayed.

    Element

    Gets or sets the Element

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

    IsBordersDirty

    Gets or sets a value indicating whether the cell borders need to be updated or not.

    Declaration
    protected bool IsBordersDirty { get; set; }
    Property Value
    Type Description
    System.Boolean

    True or False.

    IsDirty

    Gets or sets a value indicating whether it needs to be rearranged or not .

    Declaration
    protected bool IsDirty { get; set; }
    Property Value
    Type Description
    System.Boolean

    True or False.

    Remarks

    Set as true, if this needs to be re arrange.

    IsEditing

    Gets the value indicating whether the s is in editing mode or not.

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

    True or False.

    IsEnsured

    Determines whether the column in ensured or not.(i.e., properties are updated on measure override)

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

    True or False.

    IsFloatingCell

    Determines whether cell is FloatingCell or not. FloatingCell means, whenever the cell width increased when cell value is exceeds the cellsize by taking next cell width.

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

    True or false.

    IsFloodCell

    Determines whether cell is FloodCell or not. If any cells are used by floating cell then those cells are denoted as FloodCell and set the width as 0 for it.

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

    True or False.

    IsSpannedColum

    Gets a value indicating whether the cell is covered cell or not.

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

    True or False.

    IsVisible

    Gets or sets the visiblity of the column.

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

    True or false.

    Renderer

    Gets or sets the cell renderer.

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

    RowIndex

    Gets or sets the row index.

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

    Index of the row.

    Methods

    Dispose(Boolean)

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

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

    True or False .

    Overrides
    NonFinalizeDisposable.Dispose(Boolean)

    EnsureFloatingCellSize(List<GridColumn>, Size, Int32)

    Calculate the floating cell size.

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

    A list of GridColumn elements.

    System.Drawing.Size cellSize

    Size of the cell.

    System.Int32 arrayIndex

    Index.

    EnsureFloatingCellSizeOnEdit(String)

    Calculate the floating cell size in editing mode.

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

    Text to be displayed.

    GetColumnWidth()

    Declaration
    protected int GetColumnWidth()
    Returns
    Type
    System.Int32

    GetCurrentCellRendererElement()

    Used to get the edit UIElement of the CurrentCell.

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

    A UIElement.

    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 virtual Size GetDisplayTextSize(string text, Size cellSize, bool wrapText)
    Parameters
    Type Name Description
    System.String text

    Display text

    System.Drawing.Size cellSize

    cell size

    System.Boolean wrapText

    true if textwrapping is applied else false

    Returns
    Type Description
    System.Drawing.Size

    Size of the text.

    GetRowHeight()

    Used to get the row height

    Declaration
    protected int GetRowHeight()
    Returns
    Type Description
    System.Int32

    Height of the row.

    GetTextAlignment()

    Helper methods to get the horizontal alignment for the text.

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

    An instance of System.Windows.Forms.HorizontalAlignment.

    GetTextWrapping()

    Get the textwrapping for the specified cell.

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

    Returns true, if text is wrapped; otherwise, false.

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

    Used to render the borders, text, background, etc. of the OnRender(SpreadsheetPaint, Rectangle, Rectangle, Boolean, Boolean).

    Declaration
    protected virtual 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

    OnRenderBackground(SpreadsheetPaint, Rectangle)

    Render the cell background.

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

    SpreadsheetPaint object

    System.Drawing.Rectangle cellRect

    Cell rect

    OnUpdateColumn()

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

    Declaration
    protected virtual void OnUpdateColumn()

    SetTextWrapping(Boolean)

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

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

    True or false.

    UpdateBorderStyle(Int32, Int32, Pen, Boolean)

    Update the border style for the specified cell or range.

    Declaration
    protected void UpdateBorderStyle(int rowindex, int colindex, Pen pen, bool isVertical)
    Parameters
    Type Name Description
    System.Int32 rowindex

    Row index of the cell.

    System.Int32 colindex

    Column index of the cell.

    System.Drawing.Pen pen

    Outline for the cell.

    System.Boolean isVertical

    True or False.

    UpdateCellBorders()

    Update the cell borders of the current cell.

    Declaration
    protected virtual void UpdateCellBorders()

    UpdateColumn()

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

    Declaration
    public void UpdateColumn()

    UpdateFloatingCellBorders()

    Update the borders of floating cells.

    Declaration
    protected virtual void UpdateFloatingCellBorders()

    Implements

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