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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to insert a ComboBox in a header cell of a grid?

GridControl

You can place a ComboBox in a header cell of a GridControl by setting the CellType of the header to ComboBox and assign a valid datasource (Choicelist or DataSource). Refer to the following code examples.

C#

 

VB

 

GridDataBoundGrid

You can place a ComboBox in the header cell of a GridDataBoundGrid by handling QueryCellInfo and SaveCellInfo events. Unlike GridControl, the GridDataBoundGrid does not maintain any internal datastore. It reflects the data from the underlying DataTable. So set the Choicelist or DataSource datasource for the header cell in the QueryCellInfo event handler and save the edited value back to datasource in the SaveCellInfo event handler. Refer to the following code examples.

C#

 

VB

 

GridGroupingControl

You can place a ComboBox in the header cell of a GridGroupingControl by handling QueryCellIStylenfo and TableControlCellClick events. Unlike GridControl, the GridGroupingControl does not maintain any internal datastore. It reflects the data from the underlying DataTable. So set the Choicelist or DataSource datasource for the header cell in the QueryCellIStylenfo event handler and save the edited value back to datasource in the TableControlCellClick event handler. Refer to the following code examples.

C#

 

VB

 

The following screenshot displays the ComboBox in a header cell.

Figure 1: ComboBox in a header cell

 

Sample Links

CS: ComboBox_in_header

VB: ComboBox_in_header

Article ID: Published Date: Last Revised Date: Platform: Control:
4120 02/20/2015 02/15/2016 WinForms GridDataBoundGrid(Classic)
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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