Class GridCellComboBoxRenderer
Represents the class that loads the ComboBox as editor for GridComboBoxColumn.
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.Grid.Cells
Assembly: Syncfusion.SfGrid.WPF.dll
Syntax
public class GridCellComboBoxRenderer : GridVirtualizingCellRenderer<ContentControl, ComboBox>, IGridCellRenderer, IDisposable
Examples
this.sfDataGrid.CellRenderers.Remove("ComboBox");
this.sfDataGrid.CellRenderers.Add("ComboBox", new GridCellComboBoxRendererExt());
public class GridCellComboBoxRendererExt : GridCellComboBoxRenderer
{
public override void OnInitializeDisplayElement(DataColumnBase dataColumn, ContentControl uiElement, object dataContext)
{
base.OnInitializeDisplayElement(dataColumn, uiElement, dataContext);
uiElement.Foreground = new SolidColorBrush(Colors.DarkOrange);
}
}
Constructors
GridCellComboBoxRenderer()
Initializes a new instance of the GridCellComboBoxRenderer class.
Declaration
public GridCellComboBoxRenderer()
Fields
lastKeyPressed
Declaration
public Nullable<Key> lastKeyPressed
Field Value
Type |
---|
System.Nullable<System.Windows.Input.Key> |
Methods
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 DataColumnBase. |
System.Object | record | Specifies the record. |
System.Boolean | canResetBinding | Indicates whether binding can be reset or not. |
Returns
Type | Description |
---|---|
System.Boolean | True if the edit ends on the cell; 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
InitializeDisplayElement(DataColumnBase, ContentControl, Object)
Declaration
public override void InitializeDisplayElement(DataColumnBase dataColumn, ContentControl uiElement, object dataContext)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | |
System.Windows.Controls.ContentControl | uiElement | |
System.Object | dataContext |
Overrides
OnCreateDisplayUIElement()
Creates a new UIElement for the display mode of cell.
Declaration
protected override ContentControl OnCreateDisplayUIElement()
Returns
Type | Description |
---|---|
System.Windows.Controls.ContentControl | The new UIElement for the display mode of cell. |
Overrides
OnCreateEditUIElement()
Creates a new UIElement for the edit mode of cell.
Declaration
protected override ComboBox OnCreateEditUIElement()
Returns
Type | Description |
---|---|
System.Windows.Controls.ComboBox | Returns the new UIElement for edit mode of cell. |
Overrides
OnEditElementLoaded(Object, RoutedEventArgs)
Invoked when the edit element 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
OnEnteredEditMode(DataColumnBase, FrameworkElement)
Invoked when the cell is being entered the edit mode.
Declaration
protected override void OnEnteredEditMode(DataColumnBase dataColumn, FrameworkElement currentRendererElement)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | Specifies the corresponding DataColumnBase. |
System.Windows.FrameworkElement | currentRendererElement | Specifies the current renderer element. |
Overrides
OnInitializeDisplayElement(DataColumnBase, ContentControl, Object)
Method which initialize the display element of the column.
Declaration
public override void OnInitializeDisplayElement(DataColumnBase dataColumn, ContentControl uiElement, object dataContext)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | Specifies the DataColumnBase. |
System.Windows.Controls.ContentControl | uiElement | Specifies the corresponding renderer element. |
System.Object | dataContext | Specifies the data context. |
Overrides
OnInitializeEditElement(DataColumnBase, ComboBox, Object)
Method which is used to initialize the renderer element bindings with corresponding column values.
Declaration
public override void OnInitializeEditElement(DataColumnBase dataColumn, ComboBox uiElement, object dataContext)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | Specifies the DataColumnBase. |
System.Windows.Controls.ComboBox | 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(ComboBox)
Unwires the events associated with edit UIElement
Declaration
protected override void OnUnwireEditUIElement(ComboBox uiElement)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Controls.ComboBox | uiElement | Specifies the corresponding UIElement. |
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
Exceptions
Type | Condition |
---|---|
System.Exception | Thrown when value cannot be set for Unloaded editor. |
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. |