How to create a multi-select DropDown Grid in a cell
9 Dec 2019 / 1 minute to read
To have a cell that has a multi-selection dropdown grid, you must use a derived custom cell that is derived from GridDropDownGridCellModel and GridDropDownGridCellRenderer.
- In the derived renderer, the code embeds GridControl whose ListBoxSelectionMode is set to MultiSimple. The renderer uses 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, which hosts this custom CellType lists the selected options as a hyphen delimited string for every column, and the NewLine delimited string for every row.
//Creates an instance of DropDownGrid Model. DropDownGridCellModel aModel = new DropDownGridCellModel(this.gridControl1.Model); aModel.EmbeddedGrid = GridA; //Registers the DropDownGridCellModel to GridModel. gridControl1.CellModels.Add("MultiSelectCombo",aModel);
'Creates an instance of the DropDownGrid Model. Dim aModel As DropDownGridCellModel = New DropDownGridCellModel(Me.gridControl1.Model) aModel.EmbeddedGrid = GridA 'Registers the DropDownGridCellModel to GridModel. gridControl1.CellModels.Add("MultiSelectCombo",aModel)
- Set the CellType property to “MultiSelectCombo”.
//Sets the CellType to 'MultiSelectCombo'. this.gridControl1[4,2].CellType = "MultiSelectCombo";
'Sets the CellType to 'InPlaceRTB'. Me.gridControl1(4,2).CellType = "MultiSelectCombo"
Was this page helpful? Yes No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page