Class GridNestedTableControlCellRenderer
Defines a class that creates a GridTableControl as a view for the GridNestedTableControlCellModel. The GridTableControl is drawn static using the GridTableControl DrawGrid method. GridTableControl is being used in a windowless mode. All mouse and keyboard interaction is forwarded from a parent grid control to the nested table control. The table control has no window handle.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid.Grouping
Assembly: Syncfusion.Grid.Grouping.Windows.dll
Syntax
public class GridNestedTableControlCellRenderer : GridStaticCellRenderer, IQueryFocusInside, IGridDropDownCell, IPopupParent, IPopupItem, IDisposable
Remarks
You can typically access cell models through the CellRenderers property of the GridControlBase class. A nested table control cell renderer is identified through its parent relations name with an "RT" prefix.
Examples
string cellType = "RT" + relatedTable.TableDescriptor.Name;
GridNestedTableControlCellRenderer cm = this.CellRenderers[cellType] as GridNestedTableControlCellRenderer;
Dim cellType As String = "RT" + relatedTable.TableDescriptor.Name
Dim cm As GridNestedTableControlCellRenderer = Me.CellRenderers(cellType)
Constructors
GridNestedTableControlCellRenderer(GridControlBase, GridCellModelBase)
Initializes a new instance of the GridNestedTableControlCellRenderer class for the given instance of the GridControlBase and GridCellModelBase classes.
Declaration
public GridNestedTableControlCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
Parameters
Type | Name | Description |
---|---|---|
GridControlBase | grid | The instance of the GridControlBase class that displays this cell renderer. |
GridCellModelBase | cellModel | The instance of the GridCellModelBase class that holds data for this cell renderer. |
Remarks
References to GridControlBase and GridCellModelBase will be saved.
You can typically access cell models through the CellRenderers property of the GridControlBase class. A nested table control cell renderer is identified through its parent relations name with an "RT" prefix.
Examples
string cellType = "RT" + relatedTable.TableDescriptor.Name;
GridNestedTableControlCellRenderer cm = this.CellRenderers[cellType] as GridNestedTableControlCellRenderer;
Dim cellType As String = "RT" + relatedTable.TableDescriptor.Name
Dim cm As GridNestedTableControlCellRenderer = Me.CellRenderers(cellType)
Properties
Control
Gets the GridNestedTableControl that draws the nested table.
Declaration
public GridNestedTableControl Control { get; }
Property Value
Type |
---|
GridNestedTableControl |
Grid
Gets the parent GridTableControl that this cell renderer belongs to.
Declaration
public GridTableControl Grid { get; }
Property Value
Type |
---|
GridTableControl |
Model
Gets the GridNestedTableControlCellModel that this cell renderer belongs to.
Declaration
public GridNestedTableControlCellModel Model { get; }
Property Value
Type |
---|
GridNestedTableControlCellModel |
Methods
Dispose(Boolean)
Overrides and manages the unwanted resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
GetInnerCurrentCell()
Gets the currentcell from the child table. Internal only.
Declaration
public GridCurrentCell GetInnerCurrentCell()
Returns
Type | Description |
---|---|
GridCurrentCell | Current cell for the instance specified. |
GetNestedCurrentCell()
Overrides and gets the nested current cell if this cell type hosts a GridControl by itself.
Declaration
public override GridCurrentCell GetNestedCurrentCell()
Returns
Type | Description |
---|---|
GridCurrentCell | Current cell at the current instance specified. |
Overrides
OnActivated()
Overrides and triggered when the parent grid gets activated.
Declaration
protected override void OnActivated()
Overrides
OnActivating(Int32, Int32)
Overrides and determines a value indicating whether the parent grid gets activating or not.
Declaration
protected override bool OnActivating(int rowIndex, int colIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
Returns
Type | Description |
---|---|
System.Boolean | True is cell can be activated; False otherwise. |
Overrides
OnCancelMode(Int32, Int32)
Overrides and triggered when the cancel mode method call is done.
Declaration
protected override void OnCancelMode(int rowIndex, int colIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
Overrides
OnDeactivating()
Overrides and determines a value indicating whether the parent grid gets deactivating or not.
Declaration
protected override bool OnDeactivating()
Returns
Type | Description |
---|---|
System.Boolean | True if renderer can be deactivated; False if deactivation should be aborted. |
Overrides
OnDeactived(Int32, Int32)
Overrides and triggered when the grid gets deactivated.
Declaration
protected override void OnDeactived(int rowIndex, int colIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
Overrides
OnDraw(Graphics, Rectangle, Int32, Int32, GridStyleInfo)
Overrides and draws the grid.
Declaration
protected override void OnDraw(Graphics g, Rectangle clientRectangle, int rowIndex, int colIndex, GridStyleInfo style)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The instance of the System.Drawing.Graphics class. |
System.Drawing.Rectangle | clientRectangle | The inner bounds of the cell without borders. |
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
GridStyleInfo | style | An instance of the GridStyleInfo that holds the values of style properties. |
Overrides
OnGetCursor(Int32, Int32)
Overrides and triggered to get the cursor for the current cell.
Declaration
protected override Cursor OnGetCursor(int rowIndex, int colIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
Returns
Type | Description |
---|---|
System.Windows.Forms.Cursor | The System.Windows.Forms.Cursor to be displayed. |
Overrides
OnHasFocusControlChanged()
Overrides and triggered when the focus of the control gets changed.
Declaration
protected override void OnHasFocusControlChanged()
Overrides
OnHitTest(Int32, Int32, MouseEventArgs, IMouseController)
This method is called to determine whether the cell renderer wants to receive mouse events for the give cell at the given coordinates.
Declaration
protected override int OnHitTest(int rowIndex, int colIndex, MouseEventArgs e, IMouseController controller)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
System.Windows.Forms.MouseEventArgs | e | A System.Windows.Forms.MouseEventArgs with data about the mouse event. |
IMouseController | controller | The current controller requested to handle this mouse event. |
Returns
Type | Description |
---|---|
System.Int32 | Non-zero hit context value if you request to handle the mouse event; zero if you vote not to handle the mouse event. |
Overrides
OnInitialize(Int32, Int32)
Overrides and initializes the grid.
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
OnMouseDown(Int32, Int32, MouseEventArgs)
Overrides and triggered when the Mouse down event is done.
Declaration
protected override void OnMouseDown(int rowIndex, int colIndex, MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs contains the event data. |
Overrides
OnMouseHover(Int32, Int32, MouseEventArgs)
Overrides and triggered when the mouse hover event is done.
Declaration
protected override void OnMouseHover(int rowIndex, int colIndex, MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs contains the event data. |
Overrides
OnMouseHoverEnter(Int32, Int32)
Overrides and triggered when the mouse hover enter event is done.
Declaration
protected override void OnMouseHoverEnter(int rowIndex, int colIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
Overrides
OnMouseHoverLeave(Int32, Int32, EventArgs)
Overrides and triggered when the mouse hover ends.
Declaration
protected override void OnMouseHoverLeave(int rowIndex, int colIndex, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
System.EventArgs | e | The System.EventArgs contains the event data. |
Overrides
OnMouseMove(Int32, Int32, MouseEventArgs)
Overrides and triggered from the mouse down event is done.
Declaration
protected override void OnMouseMove(int rowIndex, int colIndex, MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs contains the event data. |
Overrides
OnMouseUp(Int32, Int32, MouseEventArgs)
Overrides and triggered when the mouse up event is done.
Declaration
protected override void OnMouseUp(int rowIndex, int colIndex, MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
System.Windows.Forms.MouseEventArgs | e | The System.Windows.Forms.MouseEventArgs contains the event data. |
Overrides
OnNotifyMsg(ref Message)
Overrides and triggered to notify the changes from OnVScroll, OnHScroll before grid is scrolled.
Declaration
public override void OnNotifyMsg(ref Message pMsg)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | pMsg | The message to be notified. |
Overrides
OnOutlineCurrentCell(Graphics, Rectangle)
Overrides and triggered when outlining the current cell.
Declaration
protected override void OnOutlineCurrentCell(Graphics g, Rectangle r)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The instance of the System.Drawing.Graphics class. |
System.Drawing.Rectangle | r | The bounds of the cell. |
Overrides
OnScrollInView(GridScrollCurrentCellReason)
Determines a value whether the grid is in scroll view or not when the current cell is navigating.
Declaration
public override bool OnScrollInView(GridScrollCurrentCellReason reason)
Parameters
Type | Name | Description |
---|---|---|
GridScrollCurrentCellReason | reason | Defines the reason for scrolling current cell into view. |
Returns
Type | Description |
---|---|
System.Boolean | Returns False. |
Overrides
ProcessKeyEventArgs(ref Message)
Overrides and determines a value indicating whether to process the key event args or not.
Declaration
protected override bool ProcessKeyEventArgs(ref Message m)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | m | The System.Windows.Forms.Message with data of the keyboard event. |
Returns
Type | Description |
---|---|
System.Boolean | True if key was handled; False otherwise. |
Overrides
Remarks
This is called from ProcessKeyEventArgs(ref Message) and allows your customized cell renderer to process keyboard events before the GridControlBase gets the actual KeyDown or KeyUp event.
ShouldRefreshCurrentCell()
Determines a value whether the cell needs to be repainted or not when it becomes the current cell.
Declaration
public override bool ShouldRefreshCurrentCell()
Returns
Type | Description |
---|---|
System.Boolean | Returns False. |
Overrides
SwitchNestedTableAndRestore(GridNestedTable)
Lets you switch the context of the nested control. GridBounds, Table.FilteredChildTable etc. will be adjusted.
Declaration
public GridNestedTableControlCellRenderer.GridSwitchNestedTableAndRestoreHelper SwitchNestedTableAndRestore(GridNestedTable nestedTable)
Parameters
Type | Name | Description |
---|---|---|
GridNestedTable | nestedTable | The nested table that the nested control should operate on. |
Returns
Type | Description |
---|---|
GridNestedTableControlCellRenderer.GridSwitchNestedTableAndRestoreHelper | A GridSwitchNestedTableAndRestoreHelper. When you call Dispose on this member the previous state will be restored. |
ToString()
Returns a string holding the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | String representation of the current object. |