How to access Richtextbox Symbols Unicode...

2 posts, 0 answers
  1. Madhusudhan
    Madhusudhan avatar
    2 posts
    Member since:
    Jun 2012

    Posted 22 Jun 2012 Link to this post

    Hi brilliants,
    Silverlight RadInsertSymbolDialog
    (RichtextBOX editor ,in that when we clicked "Insert Symbol" this window is opening)

    We are using this dialog to select symbols. We can get the Symbol and Font Family from the call back. But we also need the Unicode HTML equivalent number from the dialog. The Dialog shows the number (For example, for "W", it shows U+87: Uppercase letter) while we select/mouse over the symbol.

    But we need to know how to access this number for some modification.(in this example, we need to get the value "U+87")

    I need this informations,if anyone aware of it please reply to it ...its better with clear code details.


  2. Iva Toteva
    Iva Toteva avatar
    1319 posts

    Posted 26 Jun 2012 Link to this post

    Hello Madhu,

    The text that is shown in the InsertSymbolDialog at the position marked in the screenshot is calculated in the following way:
    private string GetDescription(char c)
        Dictionary<UnicodeCategory, string> unicodeCategoryNames = new Dictionary<UnicodeCategory, string>();
        foreach (UnicodeCategory category in this.GetValues(typeof(UnicodeCategory)))
            unicodeCategoryNames.Add(category, LocalizationManager.GetString("Documents_InsertSymbolDialog_UnicodeCategory_" + category.ToString()));
        return string.Format("U+{0}: {1}", (int)c, unicodeCategoryNames[char.GetUnicodeCategory(c)]);
    internal IEnumerable GetValues(Type enumType)
        if (enumType == null)
            throw new ArgumentNullException("enumType");
        if (!enumType.IsEnum)
            throw new ArgumentException("Argument must be Enum", "enumType");
        var fields = from field in enumType.GetFields()
                     where field.IsLiteral
                     select field;
        foreach (FieldInfo field in fields)
            yield return field.GetValue(enumType);

    As you can see, the "Uppercase Letter" text comes from the localization resources. You can find more about localization of RadRichTextBox - mechanisms, localization keys, etc in this article.

    If the customization you can do through localization is not sufficient, you can create your own implementation of this window. This is done by implementing the IInsertSymbolWindow interface and marking your user control with the [CustomInsertSymbolWindow] attribute.

    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft R3 2016 release webinar banner
Back to Top