Class GridProgressBarCellRenderer
Implements the renderer part of a progress bar cell.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridProgressBarCellRenderer : GridStaticCellRenderer, IQueryFocusInside, IGridDropDownCell, IPopupParent, IPopupItem, IDisposable
Remarks
Use the ProgressBar (GridProgressBarInfo) property of a GridStyleInfo to change progress bar properties for a cell.
The ProgressBar control has background, border, and foreground styles. The background styles are BackgroundStyle. The border styles are BorderStyle. The foreground styles are ProgressStyle.
The following table lists some characteristics about the ProgressBar cell type:
Item | Description |
---|---|
CellType | ProgressBar |
Renderer | GridProgressBarCellRenderer |
Model | GridProgressBarCellModel |
XP Themes Support | Yes |
Interactive | Click Only |
Control | ProgressBarAdv |
Floating Support | No |
Base Type | GridStaticCellRenderer |
The cells 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. (Default: GridBordersInfo.Default) |
CellAppearance (GridCellAppearance) | Specifies if cell edges shall be drawn raised, sunken, or flat (default). (Default: GridCellAppearance.Flat) |
CellTipText (System.String) | ToolTip text to be displayed when user hovers mouse over cell. (Default: String.Empty) |
CellType (System.String) | ProgressBar (Default: Text Box) |
Enabled (System.Boolean) | Specifies if the cell can be activated as current cell or if the cell should be skipped when moving the current cell. (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) |
Font (GridFontInfo) | The font for drawing text. (Default: GridFontInfo.Default) |
Interior (BrushInfo) | Lets you specify a solid backColor, gradient, or pattern style with both back and foreColor for a cell's background. (Default: SystemColors.Window) |
ProgressBar (GridProgressBarInfo) | A nested object with ProgressBar properties for a cell. (Default: GridProgressBarInfo.Default) |
ReadOnly (System.Boolean) | Specifies if cell contents can be modified by the user. You can programmatically change Read-only cells by setting DiscardReadOnly to True. (Default: False) |
Themed (System.Boolean) | Specifies if cell should be drawn using Windows XP themes when ThemesEnabled has been set. (Default: True) |
Constructors
GridProgressBarCellRenderer(GridControlBase, GridCellModelBase)
Initializes a new GridProgressBarCellRenderer object for the given GridControlBase and GridCellModelBase.
Declaration
public GridProgressBarCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
Parameters
Type | Name | Description |
---|---|---|
GridControlBase | grid | The GridControlBase that display 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
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.