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 have a combination of ComboBox and ButtonEdit cell within a single Grid cell in WinForms GridControl?

Platform: WinForms |
Control: GridControl

Combination of ComboBox and ButtonEdit cell

The combo box cell and button edit cell can be implemented by having a ComboCellModel and the ComboCellRenderer that is derived from GridComboCellModel and GridComboCellRenderer.

The below link helps to guide the custom cell renderer: Custom cell renderer .

The above link helps to learn about custom cell renderer, and we can learn how the cell models and cell renderer will be works.

Creating Cell Model

In the combo cell model, the combo cell renderer class object is invoked by a CreateRenderer() override method.


#region combocell model
class ComboCellModel : GridComboBoxCellModel
public ComboCellModel(GridModel grid)
    : base(grid)
    //Set the size of the button bar.
    ButtonBarSize = new System.Drawing.Size(30, 15);
public override GridCellRendererBase CreateRenderer(GridControlBase control)
    return new ComboCellRenderer(control, this);



#Region "combocell model"
Friend Class ComboCellModel
 Inherits GridComboBoxCellModel
Public Sub New(ByVal grid As GridModel)
 'Set the size of the button bar.
 ButtonBarSize = New System.Drawing.Size(30, 15)
End Sub
Public Overrides Function CreateRenderer(ByVal control As GridControlBase) As GridCellRendererBase
 Return New ComboCellRenderer(control, Me)
End Function
End Class

Creating Cell Renderer

In the combo cell renderer, the customization of the cell is achieved. The combo box button is added to ComboCellRenderer.


#region Combocell cellRenderer
class ComboCellRenderer : GridComboBoxCellRenderer
public GridCellButton button;
public ComboCellRenderer(GridControlBase control, GridCellModelBase model)
: base(control, model)
button = new GridCellButton(this);
//Add the button to the comboBox cell



#Region "Combocell cellRenderer"
Friend Class ComboCellRenderer
 Inherits GridComboBoxCellRenderer
Public button As GridCellButton
Public Sub New(ByVal control As GridControlBase, ByVal model As GridCellModelBase)
 MyBase.New(control, model)
button = New GridCellButton(Me)
'Add the button to the comboBox cell
End Sub


Adding Cell Models

The created model (ComboCellModel) can be added into CellModels collection and the cell type name ComboBoxButtonEditCell can be defined.


this.gridControl1.Model.CellModels.Add("ComboBoxButtonEditCell", new ComboCellModel(this.gridControl1.Model));



Me.gridControl1.Model.CellModels.Add("ComboBoxButtonEditCell", New ComboCellModel(Me.gridControl1.Model))


Assigning Cell type

The cell type ComboBoxButtonEditCell can be assigned to a cell or range of cells using the CellType property.


this.gridControl1[2, 3].CellType = "ComboBoxButtonEditCell";



Me.gridControl1(2, 3).CellType = "ComboBoxButtonEditCell"


Event for the Cell Button

To trigger an event when cell button clicked, the renderer.button.Clicked event can be used. This event is coded in the cell renderer level. Likewise, any events can be added in ComboBoxButtonEditCell.


ComboCellRenderer renderer = gridControl1.GetCellRenderer(2, 3) as ComboCellRenderer;
renderer.button.Clicked += button_Clicked;
void button_Clicked(object sender, GridCellEventArgs e)
MessageBox.Show(String.Format("Button Edit Pressed at ({0},{1})", e.RowIndex, e.ColIndex));



Private renderer As ComboCellRenderer = TryCast(gridControl1.GetCellRenderer(2, 3), ComboCellRenderer)
Private renderer.button.Clicked += AddressOf button_Clicked
Private Sub button_Clicked(ByVal sender As Object, ByVal e As GridCellEventArgs)
MessageBox.Show(String.Format("Button Edit Pressed at ({0},{1})", e.RowIndex, e.ColIndex))
End Sub



ComboBox with button in a grid cell


C#: ComboBox with Button

VB: ComboBox with Button


I hope you enjoyed learning about how to have a combination of ComboBox and ButtonEdit cell within a single Grid cell in WinForms GridControl.

You can refer to our WinForms GridControl’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms GridControl documentation to understand how to present and manipulate data.

For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our WinForms GridControl and other WinForms components.

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!





























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