Class GridButtonColumn
Represents a column that used to display the button as the edit element.
Inherited Members
Namespace: Syncfusion.WinForms.DataGrid
Assembly: Syncfusion.SfDataGrid.WinForms.dll
Syntax
public class GridButtonColumn : GridColumn, IDisposable, IFilterDefinition
Examples
//To add the button column with default button text.
sfDataGrid1.Columns.Add(new GridButtonColumn() { MappingName = "Action", ShowDefaultButtonText = false, DefaultButtonText = "Click"});
List<CellButton> buttons = new List<CellButton>();
buttons.Add(new CellButton() { Text = "OK" });
buttons.Add(new CellButton() { Text = "Cancel", Image = SystemIcons.Hand.ToBitmap(), Size = new Size(60, 28) });
buttons.Add(new CellButton() { Text = "AddNew", Style = new ButtonCellStyleInfo() { Padding = new Padding(4) } });
//To add the button column with multiple buttons
sfDataGrid1.Columns.Add(new GridButtonColumn() { MappingName = "Status" , Buttons = buttons, Orientation = Orientation.Vertical});
Constructors
GridButtonColumn()
Initializes a new instance of the GridButtonColumn class.
Declaration
public GridButtonColumn()
Properties
AllowDefaultButtonText
Gets or sets a value indicating whether the button needs to display the default value or not.
Declaration
[Cloneable(true)]
public bool AllowDefaultButtonText { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
If it’s set to true, It will display the DefaultButtonText of the column, otherwise display only the cell value as the button text.
Buttons
Gets or sets the list of buttons that needs to be renderer in the Grid Cell.
Declaration
[Cloneable(true)]
public List<CellButton> Buttons { get; set; }
Property Value
Type |
---|
System.Collections.Generic.List<CellButton> |
ButtonSize
Gets or sets the default size of the button.
Declaration
[Cloneable(true)]
public Size ButtonSize { get; set; }
Property Value
Type |
---|
System.Drawing.Size |
DefaultButtonText
Gets or sets the default button text of the column.
Declaration
[Cloneable(true)]
public string DefaultButtonText { get; set; }
Property Value
Type |
---|
System.String |
Image
Gets or sets the image for the GridButtonColumn.
Declaration
[Cloneable(true)]
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
[Cloneable(true)]
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
[Cloneable(true)]
public ImageList ImageList { get; set; }
Property Value
Type |
---|
System.Windows.Forms.ImageList |
ImageSize
Gets or sets the size of the image in a button.
Declaration
[Cloneable(true)]
public Size ImageSize { get; set; }
Property Value
Type |
---|
System.Drawing.Size |
Orientation
Gets or sets the orientation of rendering the multiple buttons on the button column.
Declaration
[Cloneable(true)]
public Orientation Orientation { get; set; }
Property Value
Type |
---|
System.Windows.Forms.Orientation |
TextImageRelation
Gets or sets the position of the text and image relative to each other.
Declaration
[Cloneable(true)]
public TextImageRelation TextImageRelation { get; set; }
Property Value
Type |
---|
System.Windows.Forms.TextImageRelation |