Use GridComboBoxColumn with Custom Values - Telerik UI for WinForms - KB
Product Version | Product | Author | Last modified |
---|---|---|---|
Q2 2015 | RadGridView for WinForms | Dimitar Karamfilov | July 28, 2015 |
Problem
By default you can only select values from the drop down with GridViewComboBoxColumn. Sometimes you may need to provide the user with predefined values and allow him/her to use custom ones as well.
Solution
Figure1. The final result.
To achieve this functionality, you should create a custom editor which returns the text of the combo box editor. In addition, you should create a custom cell element and override the SetContent method. This is necessary because by default the cell is looking for the proper value in the editor data source.
The default editor and the default cell element can be changed in the CellEditorRequired and CellCreated events:
The complete examples in C# and VB can be downloaded by clicking the following link.