Class GridCellCheckBoxRenderer
Represents the class that maintains the rendering of GridCheckBoxColumn
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.Grid.Cells
Assembly: Syncfusion.SfGrid.WPF.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 |
---|
System.Windows.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 |
---|---|---|
System.Windows.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. |
System.Windows.RoutedEventArgs | e | The System.Windows.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. |
System.Windows.RoutedEventArgs | e | The System.Windows.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. |
System.Windows.Controls.CheckBox | uiElement | Specifies the corresponding renderer element. |
System.Object | dataContext | Specifies the data context of the cell. |
Overrides
OnRenderContent(DrawingContext, Rect, Geometry, DataColumnBase, GridCell, Object)
Declaration
protected override void OnRenderContent(DrawingContext dc, Rect cellRect, Geometry clipGeometry, DataColumnBase dataColumnBase, GridCell gridCell, object dataContext)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | dc | |
System.Windows.Rect | cellRect | |
System.Windows.Media.Geometry | clipGeometry | |
DataColumnBase | dataColumnBase | |
GridCell | gridCell | |
System.Object | dataContext |
Overrides
OnUnwireEditUIElement(CheckBox)
Unwires the events associated with edit UIElement
Declaration
protected override void OnUnwireEditUIElement(CheckBox uiElement)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.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. |
System.Windows.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. |
System.Windows.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 |
---|---|---|
System.Windows.DependencyObject | obj | The DependencyObject. |
System.Object | value | The boolean value. |
Remarks
IsCheckedProperty attached property used only when IsThreeState is true.
ShouldGridTryToHandleKeyDown(KeyEventArgs)
Handles the key interaction with editor of corresponding column.
Declaration
protected override bool ShouldGridTryToHandleKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.KeyEventArgs | e | The System.Windows.Input.KeyEventArgs instance containing the event data. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the parent grid should be allowed to handle keys; otherwise false. |