Custom Values in GridViewComboBoxColumn
Environment
Product Version | 2018.1 220 |
Product | RadGridView for WinForms |
Description
By default one cannot add values that are not contained in the popup when GridViewComboBoxColumn is used. This article demonstrates how you can add any value and still be able to chose from predefined options.
Solution
Firs you need to add a custom editor, this way you can override the Value property and return the text when no value is selected.
Use Custom editor
Once the editor is ready you can change it by using the EditorRequired event.
Change Default Editor
The final step is to create a custom column. This is necessary because the text is formated by looking in the DataSource of the column.
Create Custom Column
That is all now you will be able to add any value in the GridViewComBoxColumn. A complete Visual Studio solution is available here.