Class GridDataBoundTreeCellRenderer
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 with treelines similar to a TreeControl.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridDataBoundTreeCellRenderer : GridTextBoxCellRenderer, IQueryFocusInside, IGridDropDownCell, IPopupParent, IPopupItem, IDisposable
Remarks
Defines the renderer part of a expandable row header cell. A renderer is created for each GridCellModelBase and GridControlBase. There can be several renderers associated with one GridDataBoundTreeCellRenderer 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 | GridDataBoundTreeCellRenderer |
Model | GridDataBoundTreeCellModel |
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 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 the3 current cell when the user clicks onto the header. Usually you do not want a header to be activated as the current cell unless you want to have editing capabilities such as allowing users 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 backcolor, gradient, or pattern style with both back and forecolor 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
GridDataBoundTreeCellRenderer(GridControlBase, GridCellModelBase)
Initializes a new GridCellRendererBase object for the given GridControlBase and GridCellModelBase.
Declaration
public GridDataBoundTreeCellRenderer(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
LineColor
Gets or sets color used for drawing the treelines.
Declaration
public Color LineColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
Methods
Draw(Graphics, Rectangle, Int32, Int32, GridStyleInfo)
Draws the content for 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
OnDrawCellButton(GridCellButton, Graphics, Int32, Int32, Boolean, GridStyleInfo)
Declaration
protected override void OnDrawCellButton(GridCellButton button, Graphics g, int rowIndex, int colIndex, bool bActive, GridStyleInfo style)
Parameters
Type | Name | Description |
---|---|---|
GridCellButton | button | |
System.Drawing.Graphics | g | |
System.Int32 | rowIndex | |
System.Int32 | colIndex | |
System.Boolean | bActive | |
GridStyleInfo | style |
Overrides
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
OnQueryShowButtons(Int32, Int32, GridStyleInfo)
Declaration
protected override bool OnQueryShowButtons(int rowIndex, int colIndex, GridStyleInfo style)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | |
System.Int32 | colIndex | |
GridStyleInfo | style |
Returns
Type |
---|
System.Boolean |