Class TreeGridCellCheckBoxRenderer
Represents the class that maintains the rendering of TreeGridCheckBoxColumn
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.TreeGrid.Renderers
Assembly: Syncfusion.Grid.WinUI.dll
Syntax
public class TreeGridCellCheckBoxRenderer : TreeGridVirtualizingCellRenderer<CheckBox, CheckBox>, ITreeGridCellRenderer, IDisposable
Examples
this.treeGrid.CellRenderers.Remove("CheckBox");
this.treeGrid.CellRenderers.Add("CheckBox", new TreeGridCellCheckBoxRendererExt());
public class TreeGridCellCheckBoxRendererExt : TreeGridCellCheckBoxRenderer
{
public override void OnInitializeEditElement(DataColumnBase dataColumn, CheckBox uiElement, object dataContext)
{
base.OnInitializeEditElement(dataColumn, uiElement, dataContext);
uiElement.IsEnabled = false;
}
}
Constructors
TreeGridCellCheckBoxRenderer()
Initializes a new instance of the TreeGridCellCheckBoxRenderer class.
Declaration
public TreeGridCellCheckBoxRenderer()
Fields
IsCheckedProperty
Dependency registration for IsCheckedProperty property.
Declaration
public static readonly DependencyProperty IsCheckedProperty
Field Value
| Type |
|---|
| Microsoft.UI.Xaml.DependencyProperty |
Remarks
The identifier for the IsCheckedProperty dependency property.
Methods
CanUpdateBinding(TreeGridColumn)
Determines whether the binding for the column can be updated.Implement this method to update binding on particular renderer whether the data context is set.
Declaration
public override bool CanUpdateBinding(TreeGridColumn column)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeGridColumn | column | The corresponding column. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the binding is updated for the column; otherwise false. |
Overrides
EndEdit(TreeDataColumnBase, Object, Boolean)
Ends the edit occuring on the cell.
Declaration
public override bool EndEdit(TreeDataColumnBase dc, object record, bool canResetBinding = false)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeDataColumnBase | dc | Specifies the corresponding TreeDataColumnBase 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
GetControlValue()
Gets the control value of the cell.
Declaration
public override object GetControlValue()
Returns
| Type | Description |
|---|---|
| System.Object | Returns the control value as |
Overrides
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 Dependency Object. |
Returns
| Type | Description |
|---|---|
| System.Object | True if ischecked property is true; Otherwise False |
Remarks
IsCheckedProperty used only when IsThreeState is true.
InitializeCellStyle(TreeDataColumnBase, Object)
Initializes the custom style for cell when the corresponding API's and Selectors are used.
Declaration
protected override void InitializeCellStyle(TreeDataColumnBase dataColumn, object record)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeDataColumnBase | dataColumn | Specifies the TreeDataColumnBase. |
| System.Object | record | The corresponding record to initialize cell style. |
Overrides
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 that contains the corresponding edit UIElement. |
| Microsoft.UI.Xaml.RoutedEventArgs | e | The Microsoft.UI.Xaml.RoutedEventArgs instance containing the event data. |
Overrides
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 that contains the corresponding edit UIElement. |
| Microsoft.UI.Xaml.RoutedEventArgs | e | The Microsoft.UI.Xaml.RoutedEventArgs instance containing the event data. |
Overrides
OnInitializeEditElement(TreeDataColumnBase, CheckBox, Object)
Method which is used to initialize the renderer element bindings with corresponding column values.
Declaration
public override void OnInitializeEditElement(TreeDataColumnBase dataColumn, CheckBox uiElement, object dataContext)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeDataColumnBase | dataColumn | Specifies the TreeDataColumnBase. |
| Microsoft.UI.Xaml.Controls.CheckBox | uiElement | Specifies the corresponding renderer element. |
| System.Object | dataContext | Specifies the data context of the cell. |
Overrides
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 | The Corresponding UIElement. |
Overrides
OnUpdateEditBinding(TreeDataColumnBase, CheckBox, Object)
Method which is used to update the renderer element bindings with corresponding column values.
Declaration
public override void OnUpdateEditBinding(TreeDataColumnBase dataColumn, CheckBox element, object dataContext)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeDataColumnBase | dataColumn | Specifies the TreeDataColumnBase. |
| 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
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
SetIsChecked(DependencyObject, Object)
Declaration
public static void SetIsChecked(DependencyObject obj, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UI.Xaml.DependencyObject | obj | This is DependencyObject. |
| System.Object | value | The Boolean value. |
Remarks
IsCheckedProperty 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. |