Class GridDataBoundRowExpandCellRenderer
Implements the renderer part for an expandable row header cell in a GridDataBoundGrid. The The expandable row header cell will display a '+' for expanded rows and a '-' for collapsed rows similar to a TreeControl.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridDataBoundRowExpandCellRenderer : GridCellRendererBase, IQueryFocusInside, IGridDropDownCell, IPopupParent, IPopupItem, IDisposable
Remarks
Defines the renderer part of an expandable row header cell. A renderer is created for each GridCellModelBase and GridControlBase. There can be several renderers associated with one GridDataBoundRowExpandCellRenderer if several views display the same GridModel.
The GridDataBoundGrid registers "DataBoundRowExpandCell" as identifier in CellType of a cells GridStyleInfo to associate this cell type with a cell.
The following table lists some characteristics about the DataBoundRowExpandCell cell type:
Item | Description |
---|---|
CellType | DataBoundRowExpandCell |
Renderer | GridDataBoundRowExpandCellRenderer |
Model | GridDataBoundRowExpandCellModel |
XP Themes Support | No |
Interactive | Click Only |
Floating Support | No |
Base Type | GridCellRendererBase |
The cell's behavior and appearance can be customized with the following properties of the GridStyleInfo class:
PropertyName | Description |
---|---|
BaseStyle (System.String) | The base style for this style instance with default values for properties that are not initialized for this style object. (Default: String.Empty) |
Borders (GridBordersInfo) | Top, left, bottom, and right border settings. To hide grid lines for a certain cell, you can set the Style of the specific edge to to be None. By default, the right and bottom borders are initialized to Standard and borders are drawn as specified in the DefaultGridBorderStyle property of a GridModel instance. (Default: GridBordersInfo.Default) |
CellAppearance (GridCellAppearance) | When set to Flat, the header will be drawn with slightly raised edges typical for cell headers. If the grid is XP Themes enabled, the headers will be drawn with XP Themes look. If you specify Sunken or Raised, the header will be drawn with sunken or raised edges and not XP Themed. (Default: GridCellAppearance.Flat) |
CellType (System.String) | DataBoundRowExpandCell (Default: Text Box) |
Enabled (System.Boolean) | Specifies if the cell can be activated as a current cell when the user click onto the header. Usually you do not want a header to be activated as a current cell unless you want to have editing capabilities such as allowing user to rename header text in place. Such renaming functionality needs to be implemented in a derived class. (Default: true) |
Error (System.String) | Holds error information if a value could not be converted to the System.Type specified with CellValueType. (Default: String.Empty) |
Interior (BrushInfo) | Lets you specify a solid back color, gradient, or pattern style with both back and fore color for a cell's background. If the grid is XP Themes enabled, this color will be ignored and the header will be drawn with default XP Themes header background. (Default: SystemColors.Window) |
TextColor (System.Drawing.Color) | Lets you specify the color of the icon. (Default: SystemColors.WindowText) |
TextMargins (GridMarginsInfo) | When drawing this header cell this specifies the minimum empty area between the text rectangle without borders and the icon. The icon will be centered inside the remaining rectangle. (Default: GridMarginsInfo.Default) |
Constructors
GridDataBoundRowExpandCellRenderer(GridControlBase, GridCellModelBase)
Initializes a new GridCellRendererBase object for the given GridControlBase and GridCellModelBase.
Declaration
public GridDataBoundRowExpandCellRenderer(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.
Methods
OnLayout(Int32, Int32, GridStyleInfo, Rectangle, Rectangle[])
This method is called from PerformLayout to calculate the client rectangle given the inner rectangle of a cell and any boundaries of cell buttons.
Declaration
protected override Rectangle OnLayout(int rowIndex, int colIndex, GridStyleInfo style, Rectangle innerBounds, Rectangle[] buttonsBounds)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
GridStyleInfo | style | The GridStyleInfo object that holds cell information. |
System.Drawing.Rectangle | innerBounds | The System.Drawing.Rectangle with the inner bounds of a cell. |
System.Drawing.Rectangle[] | buttonsBounds | An array of System.Drawing.Rectangle with bounds for each cell button element. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | A System.Drawing.Rectangle with the bounds. |
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 | A reference to GridPrepareViewStyleInfoEventArgs that holds the event data. |
Overrides
Remarks
OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs) is called from PrepareViewStyleInfo in order to allow custom formatting of a cell by changing its style object.
Set the cancel property true if you want to avoid the associated cell renderers object OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs) method to be called.
Changes made to the style object will not be saved in the grid nor cached. This event is called every time a portion of the grid is repainted and the specified cell belongs to the invalidated region of the window that needs to be redrawn.
Changes to the style object done at this time will also not be reflected when accessing cells though the models indexer. See QueryCellInfo.
note
Do not change base style or cell type at this time.