New to Telerik UI for WinFormsStart a free 30-day trial

Set CharacterCasing for GridViewComboBoxColumn

Updated over 6 months ago

Environment

Product VersionProductAuthor
2020.3.1020RadGridView for WinFormsLance 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;
    }
}

See Also