Articles in this section
Category / Section

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

1 min read

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:

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment