Class SpreadsheetComboBoxCellRenderer
Represents a class which holds the cell renderer that displays System.Windows.Controls.ComboBox in a GridCell. Override the methods for initializing content of the cell and arranging the cell visuals.
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.Spreadsheet.CellRenderer
Assembly: Syncfusion.SfSpreadsheet.WPF.dll
Syntax
public class SpreadsheetComboBoxCellRenderer : SpreadsheetVirtualizingCellRendererBase<TextBlock, ComboBox>, ISpreadsheetCellRenderer, IDisposable
Constructors
SpreadsheetComboBoxCellRenderer()
Initializes a new instance of the SpreadsheetComboBoxCellRenderer class.
Declaration
public SpreadsheetComboBoxCellRenderer()
Methods
GetControlValue()
Invoked to get the control value of the current cell .
Declaration
public override object GetControlValue()
Returns
| Type | Description |
|---|---|
| System.Object | The value of the currently selected item. |
Overrides
OnEditElementLoaded(Object, RoutedEventArgs)
Occurs when edit UIElement is loaded into cell.
Declaration
protected override void OnEditElementLoaded(object sender, RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | The source of the event. |
| System.Windows.RoutedEventArgs | e | An System.Windows.RoutedEventArgs that contains the event data. |
Overrides
OnInitializeDisplayElement(RowColumnIndex, TextBlock, SpreadsheetColumn)
Invoked when display element is initialized on the cell.
Declaration
protected override void OnInitializeDisplayElement(RowColumnIndex rowColumnIndex, TextBlock uiElement, SpreadsheetColumn column)
Parameters
| Type | Name | Description |
|---|---|---|
| RowColumnIndex | rowColumnIndex | Coordinates of a cell. |
| System.Windows.Controls.TextBlock | uiElement | An instance of System.Windows.Controls.TextBlock. |
| SpreadsheetColumn | column | An instance of SpreadsheetColumn. |
Overrides
OnInitializeEditElement(RowColumnIndex, ComboBox, SpreadsheetColumn)
Invoked when the edit element of combobox is initialized on the cell.
Declaration
protected override void OnInitializeEditElement(RowColumnIndex rowColumnIndex, ComboBox uiElement, SpreadsheetColumn column)
Parameters
| Type | Name | Description |
|---|---|---|
| RowColumnIndex | rowColumnIndex | Coordinates of a cell. |
| System.Windows.Controls.ComboBox | uiElement | An instance of System.Windows.Controls.ComboBox. |
| SpreadsheetColumn | column | An instance of SpreadsheetColumn. |
Overrides
OnRender(RowColumnIndex, DrawingContext, Rect, SpreadsheetColumn, Object)
Used to render the content of the cell. It must be override in derived class, and use their own logic to render the content.
Declaration
protected override void OnRender(RowColumnIndex cellRowColumnIndex, DrawingContext dc, Rect cellRect, SpreadsheetColumn column, object textElement)
Parameters
| Type | Name | Description |
|---|---|---|
| RowColumnIndex | cellRowColumnIndex | |
| System.Windows.Media.DrawingContext | dc | An instance of System.Windows.Media.DrawingContext. |
| System.Windows.Rect | cellRect | An instance System.Windows.Rect of cell. |
| SpreadsheetColumn | column | An instance of SpreadsheetColumn. |
| System.Object | textElement | Drawing Text. |
Overrides
OnSaveChanges()
Save the modified cell value to the given range.
Declaration
protected override void OnSaveChanges()
Overrides
OnUnwireEditUIElement(ComboBox)
Unwire or unhook the events associated with the edit UIElement.
Declaration
protected override void OnUnwireEditUIElement(ComboBox uiElement)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Controls.ComboBox | uiElement | An instance of System.Windows.Controls.ComboBox. |
Overrides
OnUpdateCellStyle(RowColumnIndex, TextBlock, SpreadsheetColumn)
Updates the style and content for display element.
Declaration
protected override void OnUpdateCellStyle(RowColumnIndex cellRowColumnIndex, TextBlock uiElement, SpreadsheetColumn column)
Parameters
| Type | Name | Description |
|---|---|---|
| RowColumnIndex | cellRowColumnIndex | Coordinates of a cell. |
| System.Windows.Controls.TextBlock | uiElement | An instance of System.Windows.Controls.ComboBox. |
| SpreadsheetColumn | column | An instance of SpreadsheetColumn. |
Overrides
OnUpdateEditCellStyle(RowColumnIndex, ComboBox, SpreadsheetColumn)
Updates the style and content for edit element.
Declaration
protected override void OnUpdateEditCellStyle(RowColumnIndex cellRowColumnIndex, ComboBox uiElement, SpreadsheetColumn column)
Parameters
| Type | Name | Description |
|---|---|---|
| RowColumnIndex | cellRowColumnIndex | Coordinates of a cell. |
| System.Windows.Controls.ComboBox | uiElement | An instance of System.Windows.Controls.ComboBox. |
| SpreadsheetColumn | column | An instance of SpreadsheetColumn. |
Overrides
OnWireEditUIElement(ComboBox)
Wire or hook the events associated with edit UIElement.
Declaration
protected override void OnWireEditUIElement(ComboBox uiElement)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Controls.ComboBox | uiElement | An instance of System.Windows.Controls.ComboBox. |
Overrides
SetControlValue(Object)
Invoked to set the control value of the current cell.
Declaration
public override bool SetControlValue(object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | value | value of the current cell. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True or False. |
Overrides
ShouldGridTryToHandleKeyDown(KeyEventArgs)
Handles all the keydown operations in the current cell.
Declaration
protected override bool ShouldGridTryToHandleKeyDown(KeyEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.KeyEventArgs | e | An System.Windows.Input.KeyEventArgs that contains the event data. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if uiElement is ComboBox; else returns false. |