Class CellButton
Represents a class that provides the information for drawing the button.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.WinForms.DataGrid
Assembly: Syncfusion.SfDataGrid.WinForms.dll
Syntax
public class CellButton : NonFinalizeDisposable, IDisposable
Constructors
CellButton()
Initializes a new instance of the CellButton class.
Declaration
public CellButton()
Properties
AutoSize
Gets or sets a value indicating whether the button width is calculated automatically or not.
Declaration
public bool AutoSize { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Image
Gets or sets the image for the CellButton.
Declaration
public Image Image { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Image |
ImageIndex
Gets or sets the index of the image in a image list to display on the button.
Declaration
public int ImageIndex { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
ImageList
Gets or sets the image list that used to display the image on the button.
Declaration
public ImageList ImageList { get; set; }
Property Value
| Type |
|---|
| System.Windows.Forms.ImageList |
ImageSize
Gets or sets the default image size on the button.
Declaration
public Size ImageSize { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Size |
Size
Gets or sets the size button.
Declaration
public Size Size { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Size |
Style
Gets or sets the style for the grid cell button.
Declaration
public ButtonCellStyleInfo Style { get; set; }
Property Value
| Type |
|---|
| ButtonCellStyleInfo |
Text
Gets or sets the button text.
Declaration
public string Text { get; set; }
Property Value
| Type |
|---|
| System.String |
TextImageRelation
Gets or sets the position of the text and image relative to each other.
Declaration
public TextImageRelation TextImageRelation { get; set; }
Property Value
| Type |
|---|
| System.Windows.Forms.TextImageRelation |
Methods
DrawButton(Graphics, Rectangle, Rectangle, String, ButtonCellStyleInfo, DataColumnBase, RowColumnIndex, Int32)
Draws the CellButton.
Declaration
protected virtual void DrawButton(Graphics paint, Rectangle cellRect, Rectangle buttonRect, string cellValue, ButtonCellStyleInfo style, DataColumnBase column, RowColumnIndex rowColumnIndex, int buttonIndex = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | paint | The System.Drawing.Graphics that used to draw the button. |
| System.Drawing.Rectangle | cellRect | The bounds of the cell. |
| System.Drawing.Rectangle | buttonRect | The bounds of the button. |
| System.String | cellValue | The display text of the button. |
| ButtonCellStyleInfo | style | The ButtonStyleInfo of the cell. |
| DataColumnBase | column | The DataColumnBase of the cell. |
| RowColumnIndex | rowColumnIndex | The row column index of the cell. |
| System.Int32 | buttonIndex | The index of the button. |
DrawImage(Graphics, Rectangle, Image)
Draws the image on the CellButton based on its image customization.
Declaration
protected virtual void DrawImage(Graphics graphics, Rectangle bounds, Image image)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | graphics | The graphics object used to draw the text. |
| System.Drawing.Rectangle | bounds | The bounds to be used when rendering the image. |
| System.Drawing.Image | image | Image to render. |
OnMouseDown(DataColumnBase, RowColumnIndex, MouseEventArgs)
Overridden to update the mouse hovering location on the cell.
Declaration
protected virtual void OnMouseDown(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| DataColumnBase | dataColumn | The DataColumnBase of the cell. |
| RowColumnIndex | rowColumnIndex | The RowColumnIndex of the cell |
| System.Windows.Forms.MouseEventArgs | e | An System.Windows.Forms.MouseHoverEventArgs that contains event data. |
OnMouseHover(DataColumnBase, RowColumnIndex, MouseEventArgs)
Occurs when the mouse hovering is done on the CellButton.
Declaration
protected virtual void OnMouseHover(DataColumnBase column, RowColumnIndex rowColumnIndex, MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| DataColumnBase | column | The DataColumnBase of the mouse hovered button. |
| RowColumnIndex | rowColumnIndex | The row column Index of the button. |
| System.Windows.Forms.MouseEventArgs | e | An System.Windows.Forms.MouseEventArgs that contains event data. |
OnMouseHoverLeave(DataColumnBase, RowColumnIndex, MouseEventArgs)
Overridden to update the previous cell on mouse hover leave is occurs.
Declaration
protected virtual void OnMouseHoverLeave(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| DataColumnBase | dataColumn | The DataColumnBase of the cell. |
| RowColumnIndex | rowColumnIndex | The RowColumnIndex of the cell. |
| System.Windows.Forms.MouseEventArgs | e | An System.Windows.Forms.MouseHoverEventArgs that contains event data. |
OnMouseMove(DataColumnBase, RowColumnIndex, MouseEventArgs)
Overridden to update the mouse hovering location on the cell.
Declaration
protected virtual void OnMouseMove(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| DataColumnBase | dataColumn | The DataColumnBase of the cell. |
| RowColumnIndex | rowColumnIndex | The RowColumnIndex of the cell |
| System.Windows.Forms.MouseEventArgs | e | An System.Windows.Forms.MouseHoverEventArgs that contains event data. |
OnMouseUp(DataColumnBase, RowColumnIndex, MouseEventArgs, Int32)
Overridden to raise the button click event of the cell.
Declaration
protected virtual void OnMouseUp(DataColumnBase dataColumn, RowColumnIndex rowColumnIndex, MouseEventArgs e, int buttonIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| DataColumnBase | dataColumn | The DataColumnBase of the cell. |
| RowColumnIndex | rowColumnIndex | The row column index of the cell. |
| System.Windows.Forms.MouseEventArgs | e | An System.Windows.Forms.MouseHoverEventArgs that contains event data. |
| System.Int32 | buttonIndex | The index of the mouse down button. |