menu

WPF

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

    Show / Hide Table of Contents

    Class GridCell

    Represents a class that provides the common functionalities of Cells in SfDataGrid.

    Inheritance
    System.Object
    GridElement
    GridCell
    GridCaptionSummaryCell
    GridGroupSummaryCell
    GridIndentCell
    GridRowHeaderCell
    GridRowHeaderIndentCell
    GridTableSummaryCell
    GridUnBoundRowCell
    GridFilterRowCell
    Implements
    System.IDisposable
    Inherited Members
    GridElement.AnimationOpacity
    GridElement.AnimationOpacityProperty
    Namespace: Syncfusion.UI.Xaml.Grid
    Assembly: Syncfusion.SfGrid.WPF.dll
    Syntax
    public class GridCell : GridElement, IDisposable

    Constructors

    GridCell()

    Initializes a new instance of GridCell class.

    Declaration
    public GridCell()

    Fields

    CellSelectionBrushProperty

    Declaration
    public static readonly DependencyProperty CellSelectionBrushProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    CurrentCellBorderBrushProperty

    Dependency registration for CurrnetCell border brush

    Declaration
    public static readonly DependencyProperty CurrentCellBorderBrushProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    CurrentCellBorderThicknessProperty

    Dependency registration for CurrentCellBorderThickness.

    Declaration
    public static readonly DependencyProperty CurrentCellBorderThicknessProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    CurrentCellBorderVisibilityProperty

    Dependency registration for CurrentCellBorderVisiblity.

    Declaration
    public static readonly DependencyProperty CurrentCellBorderVisibilityProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ErrorMessageProperty

    Dependency registration for ErrorMessage.

    Declaration
    public static readonly DependencyProperty ErrorMessageProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    SelectionBorderVisibilityProperty

    Declaration
    public static readonly DependencyProperty SelectionBorderVisibilityProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    SelectionForegroundBrushProperty

    Dependency Registration for SelectionForegroundBrush

    Declaration
    public static readonly DependencyProperty SelectionForegroundBrushProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    UseDrawingProperty

    Identifies the Syncfusion.UI.Xaml.Grid.GridCell.UseDrawing dependency property.

    Declaration
    public static readonly DependencyProperty UseDrawingProperty
    Field Value
    Type
    System.Windows.DependencyProperty
    Remarks

    The identifier for the Syncfusion.UI.Xaml.Grid.GridCell.UseDrawing dependency property.

    Properties

    CellSelectionBrush

    Declaration
    public Brush CellSelectionBrush { get; set; }
    Property Value
    Type
    System.Windows.Media.Brush

    ColumnBase

    Gets the ColumnBase details of the GridCell.

    Declaration
    public DataColumnBase ColumnBase { get; }
    Property Value
    Type
    DataColumnBase

    CurrentCellBorderBrush

    Gets or sets Brush for CurrnetCell border.

    Declaration
    public Brush CurrentCellBorderBrush { get; set; }
    Property Value
    Type
    System.Windows.Media.Brush

    CurrentCellBorderThickness

    Gets or sets a thickness for CurrentCell border

    Declaration
    public Thickness CurrentCellBorderThickness { get; set; }
    Property Value
    Type
    System.Windows.Thickness

    CurrentCellBorderVisibility

    Get or sets the CurrentCellBorder visibility which is bind to CurrentCell Border visibility property.

    Declaration
    public Visibility CurrentCellBorderVisibility { get; set; }
    Property Value
    Type
    System.Windows.Visibility

    ErrorMessage

    Gets or sets cell error message which is displayed in cell error indicator's ToolTip.

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

    HasError

    Gets a value indicating whether GridCell has error or not.

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

    SelectionBorderVisibility

    Declaration
    public Visibility SelectionBorderVisibility { get; set; }
    Property Value
    Type
    System.Windows.Visibility

    SelectionForegroundBrush

    Gets or sets the value for SelectionForegroundBrush

    Declaration
    public Brush SelectionForegroundBrush { get; set; }
    Property Value
    Type
    System.Windows.Media.Brush

    UseDrawing

    Gets or sets the value that indicates whether to load light weight template for GridCells to improve loading and scrolling performance.

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

    One of the UseDrawing enumeration that specifies how the grid cells are rendered. The default value is false./>.

    Methods

    ApplyGridCellVisualStates(String, Boolean)

    Applies the visual state for the Grid cell

    Declaration
    public void ApplyGridCellVisualStates(string cellRegion, bool canApplyDefaultState = true)
    Parameters
    Type Name Description
    System.String cellRegion

    The corresponding cell region

    System.Boolean canApplyDefaultState

    Indicates whether the default state can be applied or not for the particular grid cell.

    ApplyValidationVisualState(Boolean)

    Updates the Visual State of the GridCell based on the cell validation applied on SfDataGrid.

    Declaration
    protected virtual void ApplyValidationVisualState(bool canApplyDefaultState = true)
    Parameters
    Type Name Description
    System.Boolean canApplyDefaultState

    CanSelectCurrentCell()

    Indicates whether the current cell can be selected or not.

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

    true if the current cell can be selected; otherwise false.

    Dispose()

    Disposes all the resources used by the class.

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Disposes all the resources used by the GridCell 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.

    OnApplyTemplate()

    Invoked to apply template for GridCell.

    Declaration
    public override void OnApplyTemplate()

    OnColumnChanged()

    Invoked when columns are reused in horizontal scrolling.

    Declaration
    protected virtual void OnColumnChanged()

    OnCreateAutomationPeer()

    Returns a class-specific AutomationPeer Implementations for the Microsoft UI Automation infrasturcutre.

    Declaration
    protected override AutomationPeer OnCreateAutomationPeer()
    Returns
    Type Description
    System.Windows.Automation.Peers.AutomationPeer

    The class-specific AutomationPeer subclass.

    OnDataColumnPropertyChanged(String)

    Invoked when ColumnBase properties are changed.

    Declaration
    protected virtual void OnDataColumnPropertyChanged(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName

    The name of the property which is changed in ColumnBase.

    OnMouseDoubleClick(MouseButtonEventArgs)

    Declaration
    protected override void OnMouseDoubleClick(MouseButtonEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseButtonEventArgs e

    OnMouseDown(MouseButtonEventArgs)

    When click the pop up and select the row, the OnPreviewMouseDown() method is not hit and the row is not selected because the Scrollviewer handled the OnPreviewMouseDown method. So here we written the OnMouseDown() method to overcome this issue.

    Declaration
    protected override void OnMouseDown(MouseButtonEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseButtonEventArgs e

    OnMouseEnter(MouseEventArgs)

    Method override to set tooltip for GridCell.

    Declaration
    protected override void OnMouseEnter(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseEventArgs e

    OnMouseMove(MouseEventArgs)

    Declaration
    protected override void OnMouseMove(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseEventArgs e

    OnMouseUp(MouseButtonEventArgs)

    Declaration
    protected override void OnMouseUp(MouseButtonEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseButtonEventArgs e

    OnPreviewMouseDown(MouseButtonEventArgs)

    Declaration
    protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseButtonEventArgs e

    OnPreviewMouseUp(MouseButtonEventArgs)

    Declaration
    protected override void OnPreviewMouseUp(MouseButtonEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseButtonEventArgs e

    OnPreviewMouseWheel(MouseWheelEventArgs)

    Declaration
    protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseWheelEventArgs e

    ShowContextMenu()

    Declaration
    protected virtual bool ShowContextMenu()
    Returns
    Type
    System.Boolean

    Implements

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