We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to use a PushButton in a cell of WinForms GridControl ?

Platform: WinForms |
Control: GridControl

Push button cell type

In GridControl, you can set the CellType property to PushButton and the button is handled by using the grid’s CellButtonClicked event.


//set the celltype into pushbutton
this.gridControl1[3, 3].CellType = "PushButton";
this.gridControl1[3, 3].Description = "Push Me";
//the pushbutton is handled using the CellButtonClicked event.
void gridControl1_CellButtonClicked(object sender, Syncfusion.Windows.Forms.Grid.GridCellButtonClickedEventArgs e)
string s = string.Format("You Clicked ({0},{1})cell", e.RowIndex, e.ColIndex);



'set the celltype into pushbutton
Me.gridControl1(3, 3).CellType = "PushButton"
Me.gridControl1(3, 3).Description = "Push Me"
'the pushbutton is handled using the CellButtonClicked event.
Private Sub gridControl1_CellButtonClicked(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridCellButtonClickedEventArgs)
Dim s As String = String.Format("You Clicked ({0},{1})cell", e.RowIndex, e.ColIndex)
End Sub


The following screenshot displays the PushButton added into the cell.

Show the push button in a grid cell

Figure 1: The PushButton is added into the cell


The pushbutton is also handled by using PushButtonClicked Event.



C#: PushButton_Cell

VB: PushButton_Cell

Reference link: https://help.syncfusion.com/windowsforms/grid-control/cell-types#pushbutton-cell-type

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile