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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can I create Multi-Select Dropdown Grid in a Cell?

Solution:

To create a cell that has multi-selection dropdown grid, you have to use a derived custom cell from the GridDropDownGridCellModel and the GridDropDownGridCellRenderer. In the derived renderer, the code embeds the GridControl whose ListBoxSelectionMode is set to MultiSimple. The renderer uses the DropDownContainerCloseDropDown override to move the text in the selected rows of the embedded grid into a string that is set into the style. The CellValue of the cell in the parent grid that hosts this custom cell type lists the selected options as a hyphen delimited string for every column and the New Line delimited string for every row.

Creating CellModel:

The custom cell model is Derived from the GridDropDownGridCellModel. The custom cell renderer object is invoked by the CreateRenderer() method.

C#

VB

Creating CellRenderer:

The behavior of the cell is defined in the custom cell renderer.

C#

VB

Overrides in DropDownGridCellRenderer class:

The custom cell renderer class needs to override the following methods to implement the Multi-Select DropDown cell.

C#

VB

Adding CellModel:

The object is created for the DropDownGridCellModel and it is added to the GridControl.CellModel.

C#

VB

Assigning CellType:

C#

VB

 

Figure 1: Multi-Select DropDown in Grid Control

Figure 2: Selected Items in the DropDown

Sample Links

C#: MultiSelectDropDown

 

VB: MultiSelectDropDown

Article ID: Published Date: Last Revised Date: Platform: Control:
674 04/30/2011 04/17/2015 WinForms GridControl
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