menu

WinUI

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

    Show / Hide Table of Contents

    Class GridCellCheckBoxRenderer

    Represents the class that maintains the rendering of GridCheckBoxColumn

    Inheritance
    System.Object
    GridCellRendererBase
    GridVirtualizingCellRendererBase<Microsoft.UI.Xaml.Controls.CheckBox, Microsoft.UI.Xaml.Controls.CheckBox>
    GridVirtualizingCellRenderer<Microsoft.UI.Xaml.Controls.CheckBox, Microsoft.UI.Xaml.Controls.CheckBox>
    GridCellCheckBoxRenderer
    Implements
    IGridCellRenderer
    System.IDisposable
    Inherited Members
    GridCellRendererBase.Arrange(RowColumnIndex, FrameworkElement, Rect)
    GridCellRendererBase.BeginEdit(RowColumnIndex, FrameworkElement, GridColumn, Object)
    GridCellRendererBase.BindingExpression
    GridCellRendererBase.CanValidate()
    GridCellRendererBase.ClearRecycleBin()
    GridCellRendererBase.CommitUnboundCellValue(Object, GridColumn, Object)
    GridCellRendererBase.CurrentCellElement
    GridCellRendererBase.CurrentCellIndex
    GridCellRendererBase.CurrentCellRendererElement
    GridCellRendererBase.DataGrid
    GridCellRendererBase.Dispose()
    GridCellRendererBase.Dispose(Boolean)
    GridCellRendererBase.HasCurrentCellState
    GridCellRendererBase.IGridCellRenderer.ShouldGridTryToHandleKeyDown(KeyRoutedEventArgs)
    GridCellRendererBase.IGridCellRenderer.UpdateBindingInfo(DataColumnBase, Object, Boolean)
    GridCellRendererBase.IsDropDownable
    GridCellRendererBase.IsEditable
    GridCellRendererBase.IsFocused
    GridCellRendererBase.IsFocusible
    GridCellRendererBase.IsInEditing
    GridCellRendererBase.Measure(RowColumnIndex, FrameworkElement, Size)
    GridCellRendererBase.OnArrange(RowColumnIndex, FrameworkElement, Rect)
    GridCellRendererBase.OnMeasure(RowColumnIndex, FrameworkElement, Size)
    GridCellRendererBase.OnPrepareUIElements()
    GridCellRendererBase.OnPrepareUIElements(DataColumnBase, Object, Boolean)
    GridCellRendererBase.OnPreviewTextInput(KeyRoutedEventArgs)
    GridCellRendererBase.OnUnloadUIElements(DataColumnBase)
    GridCellRendererBase.OnUpdateBindingInfo(DataColumnBase, Object, Boolean)
    GridCellRendererBase.OnUpdateStyleInfo(DataColumnBase, Object)
    GridCellRendererBase.PrepareUIElements(DataColumnBase, Object, Boolean)
    GridCellRendererBase.PreviewInputText
    GridCellRendererBase.PreviewTextInput(KeyRoutedEventArgs)
    GridCellRendererBase.ResetCurrentCellState()
    GridCellRendererBase.SetFocus(Boolean)
    GridCellRendererBase.SetFocus(FrameworkElement, Boolean)
    GridCellRendererBase.SupportsRenderOptimization
    GridCellRendererBase.UnloadUIElements(DataColumnBase)
    GridCellRendererBase.UpdateBindingInfo(DataColumnBase, Object, Boolean)
    GridCellRendererBase.UpdateCellStyle(DataColumnBase, Object)
    GridCellRendererBase.UpdateCurrentCellState(FrameworkElement, Boolean)
    GridCellRendererBase.UpdateSource(FrameworkElement)
    GridCellRendererBase.UpdateToolTip(DataColumnBase)
    GridCellRendererBase.UseOnlyRendererElement
    GridVirtualizingCellRenderer<CheckBox, CheckBox>.CurrentRendererValueChanged()
    GridVirtualizingCellRenderer<CheckBox, CheckBox>.EditorType
    GridVirtualizingCellRenderer<CheckBox, CheckBox>.OnInitializeDisplayElement(DataColumnBase, CheckBox, Object)
    GridVirtualizingCellRenderer<CheckBox, CheckBox>.OnInitializeEditElement(DataColumnBase, CheckBox, Object)
    GridVirtualizingCellRenderer<CheckBox, CheckBox>.OnInitializeTemplateElement(DataColumnBase, ContentControl, Object)
    GridVirtualizingCellRenderer<CheckBox, CheckBox>.OnUpdateDisplayBinding(DataColumnBase, CheckBox, Object)
    GridVirtualizingCellRenderer<CheckBox, CheckBox>.OnUpdateEditBinding(DataColumnBase, CheckBox, Object)
    GridVirtualizingCellRenderer<CheckBox, CheckBox>.OnUpdateTemplateBinding(DataColumnBase, ContentControl, Object)
    GridVirtualizingCellRenderer<CheckBox, CheckBox>.ShouldGridTryToHandleKeyDown(KeyRoutedEventArgs)
    GridVirtualizingCellRenderer<CheckBox, CheckBox>.TextAlignmentToHorizontalAlignment(TextAlignment)
    GridVirtualizingCellRenderer<CheckBox, CheckBox>.UpdateToolTip(DataColumnBase)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.AllowRecycle
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.BeginEdit(RowColumnIndex, FrameworkElement, GridColumn, Object)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.ClearRecycleBin()
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.DisplayRecycleBin
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.Dispose(Boolean)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.EditRecycleBin
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.EndEdit(DataColumnBase, Object, Boolean)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.InitializeCellStyle(DataColumnBase, Object)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.InitializeDisplayElement(DataColumnBase, CheckBox, Object)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.InitializeEditElement(DataColumnBase, CheckBox, Object)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.InitializeTemplateElement(DataColumnBase, ContentControl, Object)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnArrange(RowColumnIndex, FrameworkElement, Rect)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnCreateDisplayUIElement()
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnCreateEditUIElement()
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnEditElementLoaded(Object, RoutedEventArgs)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnEditElementLostFocus(Object, RoutedEventArgs)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnEditElementUnloaded(Object, RoutedEventArgs)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnEditingComplete(DataColumnBase, FrameworkElement)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnEnteredEditMode(DataColumnBase, FrameworkElement)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnMeasure(RowColumnIndex, FrameworkElement, Size)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnPrepareUIElements(DataColumnBase, Object, Boolean)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnUnloadUIElements(DataColumnBase)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnUnwireDisplayUIElement(CheckBox)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnUnwireEditUIElement(CheckBox)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnUnwireTemplateUIElement(ContentControl)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnUpdateBindingInfo(DataColumnBase, Object, Boolean)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnUpdateStyleInfo(DataColumnBase, Object)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnWireDisplayUIElement(CheckBox)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnWireEditUIElement(CheckBox)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.OnWireTemplateUIElement(ContentControl)
    GridVirtualizingCellRendererBase<CheckBox, CheckBox>.TemplateRecycleBin
    Namespace: Syncfusion.UI.Xaml.DataGrid.Renderers
    Assembly: Syncfusion.Grid.WinUI.dll
    Syntax
    public class GridCellCheckBoxRenderer : GridVirtualizingCellRenderer<CheckBox, CheckBox>, IGridCellRenderer, IDisposable
    Examples
    this.sfDataGrid.CellRenderers.Remove("CheckBox");
    this.sfDataGrid.CellRenderers.Add("CheckBox", new GridCellCheckBoxRendererExt());
    public class GridCellCheckBoxRendererExt : GridCellCheckBoxRenderer
    {
     public override void OnInitializeEditElement(DataColumnBase dataColumn, CheckBox uiElement, object dataContext)
       {
           base.OnInitializeEditElement(dataColumn, uiElement, dataContext);
           uiElement.IsEnabled = false;
       }
    }

    Constructors

    GridCellCheckBoxRenderer()

    Initializes a new instance of the GridCellCheckBoxRenderer class.

    Declaration
    public GridCellCheckBoxRenderer()

    Fields

    IsCheckedProperty

    Dependency registration for IsCheckedProperty property.

    Declaration
    public static readonly DependencyProperty IsCheckedProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    Methods

    CanCheckAddNewRowAtFirstClick()

    Method which is used to decide whether AddNewRowControl check box column can get check at first click or not.

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

    True, if AddNewRowControl checkbox column can check at first click; otherwise false.

    CanUpdateBinding(GridColumn)

    Determines whether the binding for the column can be updated. Implement this method to update binding on particular renderer when the data context is set.

    Declaration
    public override bool CanUpdateBinding(GridColumn column)
    Parameters
    Type Name Description
    GridColumn column

    The corresponding column.

    Returns
    Type Description
    System.Boolean

    True if the binding is updated for the column; otherwise false.

    Overrides
    GridCellRendererBase.CanUpdateBinding(GridColumn)

    EndEdit(DataColumnBase, Object, Boolean)

    Ends the edit occuring on the cell.

    Declaration
    public override bool EndEdit(DataColumnBase dc, object record, bool canResetBinding = false)
    Parameters
    Type Name Description
    DataColumnBase dc

    Specifies the corresponding DataColumnBase of the cell.

    System.Object record

    Specifies the corresponding record.

    System.Boolean canResetBinding

    Indicates whether binding can be reset or not.

    Returns
    Type Description
    System.Boolean

    Returns true if the editing is completed ; otherwise, false.

    Overrides
    Syncfusion.UI.Xaml.DataGrid.Renderers.GridVirtualizingCellRendererBase<Microsoft.UI.Xaml.Controls.CheckBox, Microsoft.UI.Xaml.Controls.CheckBox>.EndEdit(Syncfusion.UI.Xaml.DataGrid.DataColumnBase, System.Object, System.Boolean)

    GetControlValue()

    Gets the control value of the cell.

    Declaration
    public override object GetControlValue()
    Returns
    Type Description
    System.Object

    The control value of the cell.

    Overrides
    GridCellRendererBase.GetControlValue()

    GetIsChecked(DependencyObject)

    Gets the IsCheckedProperty value of checkbox which is bound with underlying data object.

    Declaration
    public static object GetIsChecked(DependencyObject obj)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.DependencyObject obj

    The DependencyObject.

    Returns
    Type Description
    System.Object

    True, if checkbox is checked; otherwise false.

    Remarks

    IsCheckedProperty used only when IsThreeState is true.

    OnEditElementLoaded(Object, RoutedEventArgs)

    Invoked when the edit element(CheckBox) is loaded on the cell in column.

    Declaration
    protected override void OnEditElementLoaded(object sender, RoutedEventArgs e)
    Parameters
    Type Name Description
    System.Object sender

    The sender.

    Microsoft.UI.Xaml.RoutedEventArgs e

    The Microsoft.UI.Xaml.RoutedEventArgs instance containing the event data.

    Overrides
    Syncfusion.UI.Xaml.DataGrid.Renderers.GridVirtualizingCellRendererBase<Microsoft.UI.Xaml.Controls.CheckBox, Microsoft.UI.Xaml.Controls.CheckBox>.OnEditElementLoaded(System.Object, Microsoft.UI.Xaml.RoutedEventArgs)

    OnEditElementUnloaded(Object, RoutedEventArgs)

    Invoked when the edit element(CheckBox) is unloaded on the cell in column.

    Declaration
    protected override void OnEditElementUnloaded(object sender, RoutedEventArgs e)
    Parameters
    Type Name Description
    System.Object sender

    The sender.

    Microsoft.UI.Xaml.RoutedEventArgs e

    The Microsoft.UI.Xaml.RoutedEventArgs instance containing the event data.

    Overrides
    Syncfusion.UI.Xaml.DataGrid.Renderers.GridVirtualizingCellRendererBase<Microsoft.UI.Xaml.Controls.CheckBox, Microsoft.UI.Xaml.Controls.CheckBox>.OnEditElementUnloaded(System.Object, Microsoft.UI.Xaml.RoutedEventArgs)

    OnInitializeEditElement(DataColumnBase, CheckBox, Object)

    Method which is used to initialize the renderer element bindings with corresponding column values.

    Declaration
    public override void OnInitializeEditElement(DataColumnBase dataColumn, CheckBox uiElement, object dataContext)
    Parameters
    Type Name Description
    DataColumnBase dataColumn

    Specifies the DataColumnBase.

    Microsoft.UI.Xaml.Controls.CheckBox uiElement

    Specifies the corresponding renderer element.

    System.Object dataContext

    Specifies the data context of the cell.

    Overrides
    Syncfusion.UI.Xaml.DataGrid.Renderers.GridVirtualizingCellRenderer<Microsoft.UI.Xaml.Controls.CheckBox, Microsoft.UI.Xaml.Controls.CheckBox>.OnInitializeEditElement(Syncfusion.UI.Xaml.DataGrid.DataColumnBase, Microsoft.UI.Xaml.Controls.CheckBox, System.Object)

    OnUnwireEditUIElement(CheckBox)

    Unwires the events associated with edit UIElement

    Declaration
    protected override void OnUnwireEditUIElement(CheckBox uiElement)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Controls.CheckBox uiElement

    Specifies the Corresponding UIElement.

    Overrides
    Syncfusion.UI.Xaml.DataGrid.Renderers.GridVirtualizingCellRendererBase<Microsoft.UI.Xaml.Controls.CheckBox, Microsoft.UI.Xaml.Controls.CheckBox>.OnUnwireEditUIElement(Microsoft.UI.Xaml.Controls.CheckBox)

    OnUpdateEditBinding(DataColumnBase, CheckBox, Object)

    Method which is used to update the renderer element bindings with corresponding column values.

    Declaration
    public override void OnUpdateEditBinding(DataColumnBase dataColumn, CheckBox element, object dataContext)
    Parameters
    Type Name Description
    DataColumnBase dataColumn

    Specifies the DataColumnBase.

    Microsoft.UI.Xaml.Controls.CheckBox element

    Specifies the corresponding element to update binding of edit element.

    System.Object dataContext

    Specifies the data context of the cell.

    Overrides
    Syncfusion.UI.Xaml.DataGrid.Renderers.GridVirtualizingCellRenderer<Microsoft.UI.Xaml.Controls.CheckBox, Microsoft.UI.Xaml.Controls.CheckBox>.OnUpdateEditBinding(Syncfusion.UI.Xaml.DataGrid.DataColumnBase, Microsoft.UI.Xaml.Controls.CheckBox, System.Object)

    SetControlValue(Object)

    Sets the control value of the cell.

    Declaration
    public override void SetControlValue(object value)
    Parameters
    Type Name Description
    System.Object value

    Specifies the value to set the control value of the cell.

    Overrides
    GridCellRendererBase.SetControlValue(Object)

    SetCurrentCellState(RowColumnIndex, FrameworkElement, Boolean, Boolean, GridColumn, DataColumnBase)

    Sets the current cell state when the cell is activated.

    Declaration
    public override void SetCurrentCellState(RowColumnIndex currentCellIndex, FrameworkElement currentCellElement, bool isInEditing, bool isFocused, GridColumn column, DataColumnBase dc)
    Parameters
    Type Name Description
    RowColumnIndex currentCellIndex

    Specifies the index of cell.

    Microsoft.UI.Xaml.FrameworkElement currentCellElement

    The corresponding current cell uielement.

    System.Boolean isInEditing

    Specifies whether the current cell is editable or not.

    System.Boolean isFocused

    Specifies whether the current cell is focused or not.

    GridColumn column

    The corresponding column to set the current cell state.

    DataColumnBase dc

    The corresponding data column to set the current cell state.

    Overrides
    GridCellRendererBase.SetCurrentCellState(RowColumnIndex, FrameworkElement, Boolean, Boolean, GridColumn, DataColumnBase)

    SetIsChecked(DependencyObject, Object)

    Sets the IsCheckedProperty value of checkbox which is bound with underlying data object.

    Declaration
    public static void SetIsChecked(DependencyObject obj, object value)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.DependencyObject obj

    The DependencyObject.

    System.Object value

    The boolean value.

    Remarks

    IsCheckedProperty attached property used only when IsThreeState is true.

    ShouldGridTryToHandleKeyDown(KeyRoutedEventArgs)

    Handles the key interaction with editor of corresponding column.

    Declaration
    protected override bool ShouldGridTryToHandleKeyDown(KeyRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.KeyRoutedEventArgs e

    The Microsoft.UI.Xaml.Input.KeyRoutedEventArgs instance containing the event data.

    Returns
    Type Description
    System.Boolean

    Returns true if the parent grid should be allowed to handle keys; otherwise false.

    Overrides
    Syncfusion.UI.Xaml.DataGrid.Renderers.GridVirtualizingCellRenderer<Microsoft.UI.Xaml.Controls.CheckBox, Microsoft.UI.Xaml.Controls.CheckBox>.ShouldGridTryToHandleKeyDown(Microsoft.UI.Xaml.Input.KeyRoutedEventArgs)

    Implements

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