We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

sfRichTextBoxAdv how to set selection to all caps etc.

Thread ID:





132564 Sep 8,2017 02:31 PM UTC Sep 11,2017 05:53 AM UTC WPF 1
Tags: SfRichTextBoxAdv
Chris Devol
Asked On September 8, 2017 02:31 PM UTC

I want to be able to set the selected text to all caps, small caps, and all lowercase, in code-behind. The standard wpf RichTextBox allows this by setting the CharacterCasing dependencyproperty. How to do this in the syncfusion version? (using code-behind).

Arumuga Perumal S [Syncfusion]
Replied On September 11, 2017 05:53 AM UTC

Hi Chris,

Thank you for contacting Syncfusion support.

Currently our WPF SfRichTextBoxAdv does not provide support for character casing property. We have already logged this requirement as feature request. We will implement this feature in any of our upcoming releases. We usually have an interval of at least three months between releases. The feature implementation would also greatly depend on the factors such as product design, code compatibility and complexity. We request you to visit our website periodically for feature related updates.

However, you can replace the selected text to all caps or lower case using Selection.InsertText() API. Using this API will convert the replaced text to single formatting even though the selected text contains different formatting. Also the text will be preserved in converted case on exporting. Kindly refer the sample code below.


/// <summary> 
/// Converts the casing of selected text in SfRichTextBoxAdv. 
/// </summary> 
/// <param name="isLower">Specifies whether the text to be converted in lower case.</param> 
public void ConvertCase(bool isLower) 
    // Gets the selected text. 
    string text = richTextBoxAdv.Selection.Text; 
    // Converts the casing of selected text. 
    string replaceText = isLower ? text.ToLower() : text.ToUpper(); 
    if (!text.Equals(replaceText)) 
        // Store the current selection positions. 
        string start = richTextBoxAdv.Selection.Start.GetHierarchicalIndex; 
        string end = richTextBoxAdv.Selection.End.GetHierarchicalIndex; 
        // Replace the text to converted casing. 
        // Restore the selection positions. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon