New to Telerik UI for WinForms? Start a free 30-day trial
Set CharacterCasing for GridViewComboBoxColumn
Updated over 6 months ago
Environment
| Product Version | Product | Author |
|---|---|---|
| 2020.3.1020 | RadGridView for WinForms | Lance McCarthy |
Description
Currently, you cannot set CharacterCasing for a GridViewComboBoxColumn's editor via a top-level property.
Solution
You can use the RadGridView CellEditorInitialized event to access the RadDropDownListEditor. With that reference, you can set the internal TextBoxItem's CharacterCasing property directly.
Here is an example where we enforce Upper-Case:
C#
private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
var ddlEditor = e.ActiveEditor as RadDropDownListEditor;
if (ddlEditor != null)
{
var element = ddlEditor.EditorElement as RadDropDownListEditorElement;
element.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
element.TextBox.TextBoxItem.CharacterCasing = CharacterCasing.Upper;
}
}