Class GridUITypeEditorCellRenderer
Defines the renderer part of a drop-down with a ListControl-like grid or a UITypeEditor that display choices for a cell determined through the System.ComponentModel.TypeConverter.GetStandardValues method of a System.ComponentModel.TypeConverter.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridUITypeEditorCellRenderer : GridDropDownStandardValuesCellRenderer, IQueryFocusInside, IGridDropDownCell, IPopupParent, IPopupItem, IDisposable, IWindowsFormsEditorService, IServiceProvider
Remarks
The GridUITypeEditorCellRenderer supports an autocomplete feature that will fill the text with possible matches from the drop-down list while the user is entering text.
A renderer is created for each GridCellModelBase and GridControlBase. There can be several renderers associated with one GridUITypeEditorCellModel if several views display the same GridModel.
Constructors
GridUITypeEditorCellRenderer(GridControlBase, GridCellModelBase)
Initializes a new GridUITypeEditorCellRenderer object for the given GridControlBase and GridCellModelBase.
Declaration
public GridUITypeEditorCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
Parameters
Type | Name | Description |
---|---|---|
GridControlBase | grid | The GridControlBase that displays this cell renderer. |
GridCellModelBase | cellModel | The GridCellModelBase that holds data for this cell renderer that should be shared among views. |
Remarks
References to GridControlBase, and GridCellModelBase will be saved.
Properties
CurrentInstance
Gets or sets CurrentInstance. Used internally.
Declaration
public object CurrentInstance { get; set; }
Property Value
Type |
---|
System.Object |
Model
Gets the data model for this renderer.
Declaration
public GridUITypeEditorCellModel Model { get; }
Property Value
Type |
---|
GridUITypeEditorCellModel |
Methods
Dispose(Boolean)
Unwires any events subscribed from GridDropDownStandardValuesCell.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Overrides
Remarks
See the documentation for the System.ComponentModel.Component class and its Dispose member.
Draw(Graphics, Rectangle, Int32, Int32, GridStyleInfo)
Draw the content of specified cell.
Declaration
public override void Draw(Graphics g, Rectangle cellRectangle, int rowIndex, int colIndex, GridStyleInfo style)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | Graphics context. |
System.Drawing.Rectangle | cellRectangle | Cell rectangle. |
System.Int32 | rowIndex | Row index. |
System.Int32 | colIndex | Column index. |
GridStyleInfo | style | Cell style information. |
Overrides
DropDownContainerCloseDropDown(Object, PopupClosedEventArgs)
Indicates that the popup child was closed.
Declaration
public override void DropDownContainerCloseDropDown(object sender, PopupClosedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | Event source. |
PopupClosedEventArgs | e | The PopupClosedEventArgsthat contains event data. |
Overrides
DropDownContainerShowedDropDown(Object, EventArgs)
Occurs after the popup child was dropped down and made visible.
Declaration
public override void DropDownContainerShowedDropDown(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | Event source. |
System.EventArgs | e | The System.EventArgsthat contains event data. |
Overrides
DropDownContainerShowingDropDown(Object, CancelEventArgs)
Occurs when the drop down is about to be shown.
Declaration
public override void DropDownContainerShowingDropDown(object sender, CancelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | Event source. |
System.ComponentModel.CancelEventArgs | e | The System.ComponentModel.CancelEventArgsthat contains event data. |
Overrides
GetDropDownPaintValueWidth()
Returns the width of a possible "Glyph" to be drawn before the cell value. This method is overridden by the UITypeEditorCellRenderer
Declaration
protected override int GetDropDownPaintValueWidth()
Returns
Type | Description |
---|---|
System.Int32 | The width in pixel for the glyph. |
Overrides
GetPaintValueSupported(GridStyleInfo, UITypeEditor)
Determines if the UITypeEditor supports painting glyphs before the text.
Declaration
protected virtual bool GetPaintValueSupported(GridStyleInfo style, UITypeEditor editor)
Parameters
Type | Name | Description |
---|---|---|
GridStyleInfo | style | The GridStyleInfo style of the parent cell. |
System.Drawing.Design.UITypeEditor | editor | The System.Drawing.Design.UITypeEditorUITypeEditor |
Returns
Type | Description |
---|---|
System.Boolean | true if glyphs should be painted. |
GetPaintValueWidth()
Returns the width of the glyph
Declaration
protected virtual int GetPaintValueWidth()
Returns
Type | Description |
---|---|
System.Int32 | returns 20 |
ListControlGridCellDrawn(Object, GridDrawCellEventArgs)
Event handler for CellDrawn event of dropdown table.
Declaration
protected override void ListControlGridCellDrawn(object sender, GridDrawCellEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | Event source. |
GridDrawCellEventArgs | e | The GridDrawCellEventArgsthat contains event data. |
Overrides
ListControlGridPrepareViewStyleInfo(Object, GridPrepareViewStyleInfoEventArgs)
Event handler for PrepareViewStyleInfo event of dropdown table.
Declaration
protected override void ListControlGridPrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | Event source. |
GridPrepareViewStyleInfoEventArgs | e | The GridPrepareViewStyleInfoEventArgsthat contains event data. |
Overrides
NotifyCurrentCellChanged()
Raises the GridCurrentCell.CellChanged event indicating the contents of the current cell have been changed (e.g. in response to a TextBox.Changed event).
Declaration
protected override void NotifyCurrentCellChanged()
Overrides
Remarks
If you have implemented a custom cell type you should call this method from your derived renderer if you support modifying the cell contents.
OnDeactived(Int32, Int32)
Called from GridCurrentCell.Deactivated after the current cell is deactivated and before the GridCurrentCell.Deactivated event.
Declaration
protected override void OnDeactived(int rowIndex, int colIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | |
System.Int32 | colIndex |
Overrides
OnDraw(Graphics, Rectangle, Int32, Int32, GridStyleInfo)
This method is called from the cell renderer's draw method to draw the contents of the client bounds for the cell, e.g. the text for a static cell.
Declaration
protected override void OnDraw(Graphics g, Rectangle clientRectangle, int rowIndex, int colIndex, GridStyleInfo style)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | Points to the device context. |
System.Drawing.Rectangle | clientRectangle | Specifies the client rectangle. It is the cell rectangle without buttons and borders. |
System.Int32 | rowIndex | Specifies the row id. |
System.Int32 | colIndex | Specifies the column id. |
GridStyleInfo | style | A reference to the style object of the cell. |
Overrides
Remarks
When drawing cells, it is necessary to determine if the specified cell (with rowIndex and colIndex) is the current cell and if it is active.
If your control is associated with a control and supports in-place editing and the specified cell is the current cell, you should position the control. Take a look at the GridTextBoxCellRenderer implementation of this method for an example.
Otherwise, you can simply draw the cell.
OnInitialize(Int32, Int32)
This method gets called from the cell renderer's initialize method. Override this method if you need to any initialization for the current cell.
Declaration
protected override void OnInitialize(int rowIndex, int colIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
Overrides
OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs)
Allows custom formatting of a cell by changing its style object.
Declaration
public override void OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridPrepareViewStyleInfoEventArgs | e | The GridPrepareViewStyleInfoEventArgsthat contains event data. |
Overrides
OnShowDropDown()
This is called from GridCurrentCell.ShowDropDown after BeginEdit has been called.
Declaration
protected override void OnShowDropDown()
Overrides
Remarks
If your renderer supports dropped-down state, the drop-down window should be made visible at this time.
PaintValue(Graphics, Rectangle, Int32, Int32, GridStyleInfo, UITypeEditor, Object)
Paints a glyph before the text by calling the UITypeEditor.PaintValue method
Declaration
protected virtual void PaintValue(Graphics g, Rectangle bounds, int rowIndex, int colIndex, GridStyleInfo style, UITypeEditor editor, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | Points to the device context. |
System.Drawing.Rectangle | bounds | Specifies the client rectangle. It is the cell rectangle without buttons and borders. |
System.Int32 | rowIndex | Specifies the row id. |
System.Int32 | colIndex | Specifies the column id. |
GridStyleInfo | style | A reference to the style object of the cell. |
System.Drawing.Design.UITypeEditor | editor | The System.Drawing.Design.UITypeEditorUITypeEditor |
System.Object | value | The cell value. |
Explicit Interface Implementations
IServiceProvider.GetService(Type)
Gets the service object of the specified type.
Declaration
object IServiceProvider.GetService(Type classService)
Parameters
Type | Name | Description |
---|---|---|
System.Type | classService | An object that specifies the type of service object to get. |
Returns
Type | Description |
---|---|
System.Object | A service object of type serviceType.-or- null if there is no service object of type serviceType. |