Class GridCellCheckBoxRenderer
Represents the class that maintains the rendering of GridCheckBoxColumn
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.Grid.Cells
Assembly: Syncfusion.SfGrid.UWP.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 |
---|
Windows.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
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
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
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 |
---|---|---|
Windows.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. |
Windows.UI.Xaml.RoutedEventArgs | e | The Windows.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. |
Windows.UI.Xaml.RoutedEventArgs | e | The Windows.UI.Xaml.RoutedEventArgs instance containing the event data. |
Overrides
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. |
Windows.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 |
---|---|---|
Windows.UI.Xaml.Controls.CheckBox | uiElement | Specifies the Corresponding UIElement. |
Overrides
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. |
Windows.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
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. |
Windows.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
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 |
---|---|---|
Windows.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 |
---|---|---|
Windows.UI.Xaml.Input.KeyRoutedEventArgs | e | The Windows.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. |