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

Set CharacterCasing Property of the Input Area

Updated on Sep 24, 2025

The purpose of this tutorial is to show you how to set the CharacterCasing property of the InputArea of an editable RadComboBox(RadComboBox's IsEditable property is set to True).

The idea in this case is to create a new Attached Property in a helper class.

C#
	public class EditableComboBox
	{
	    public static int GetCharacterCasing( DependencyObject obj )
	    {
	        return ( int )obj.GetValue( CharacterCasingProperty );
	    }
	
	    public static void SetCharacterCasing( DependencyObject obj, int value )
	    {
	        obj.SetValue( CharacterCasingProperty, value );
	    }
	
	    public static readonly DependencyProperty CharacterCasingProperty =
	        DependencyProperty.RegisterAttached( "CharacterCasing", typeof( int ), typeof( EditableComboBox ), new UIPropertyMetadata( OnCharacterCasingChanged ) );
	
	    private static void OnCharacterCasingChanged( DependencyObject obj, DependencyPropertyChangedEventArgs e )
	    {
	    }
	}

In the OnCharacterCasingChanged() event handler you should perform the following step.

  • Get the target combobox.

  • Get the PART_EditableTextBox element from its template.

  • The PART_EditableTextBox is a TextBox and you can easily set its CharacterCasing property.

C#
	public class EditableComboBox
	{
	    public static int GetCharacterCasing( DependencyObject obj )
	    {
	        return ( int )obj.GetValue( CharacterCasingProperty );
	    }
	    public static void SetCharacterCasing( DependencyObject obj, int value )
	    {
	        obj.SetValue( CharacterCasingProperty, value );
	    }
	    public static readonly DependencyProperty CharacterCasingProperty =
	        DependencyProperty.RegisterAttached( "CharacterCasing", typeof( int ), typeof( EditableComboBox ), new UIPropertyMetadata( OnCharacterCasingChanged ) );
	    private static void OnCharacterCasingChanged( DependencyObject obj, DependencyPropertyChangedEventArgs e )
	    {
	        var comboBox = obj as Telerik.Windows.Controls.RadComboBox;
	        if ( comboBox == null )
	        {
	            return;
	        }
	        comboBox.Dispatcher.BeginInvoke( DispatcherPriority.Loaded,
	            ( DispatcherOperationCallback )delegate
	            {
	                var childrenCount = VisualTreeHelper.GetChildrenCount( comboBox );
	                if ( childrenCount > 0 )
	                {
	                    var rootElement = VisualTreeHelper.GetChild( comboBox, 0 ) as FrameworkElement;
	                    TextBox textBox = ( TextBox )rootElement.FindName( "PART_EditableTextBox" );
	                    if ( textBox != null )
	                        textBox.SetValue( TextBox.CharacterCasingProperty, ( CharacterCasing )e.NewValue );
	                }
	                return null;
	            }
	            , null );
	    }
	}

Finally set the property in XAML.

XAML
	<telerik:RadComboBox IsEditable="True" example:EditableComboBox.CharacterCasingProperty="1"/>

ote that you have to set the RadComboBox's IsEditable property to True.

Not finding the help you need?
Contact Support