TextPrimitive doesn't size properly if it contains "&&" characters.

2 posts, 1 answers
  1. Michael
    Michael avatar
    33 posts
    Member since:
    Mar 2009

    Posted 21 Apr 2009 Link to this post

    By default TextPrimitive renders the '&' character as an underscore on the following character, like a menu hotkey.  I need to actually display an ampersand on the screen.  I found that if I double the character ("&&"), the TextPrimitive displays the ampersand.  However, it no longer sizes properly to the text it contains.  I'm wondering if the TextPrimitive sizing code thinks the ampersands will cause underlines even though the rendering code draws an ampersand.
  2. Answer
    Peter avatar
    1159 posts

    Posted 22 Apr 2009 Link to this post

    Hello Michael,

    Thank you for writing.

    I have managed to reproduce the described behavior. There is an issue with the text measure when you are trying to escape ampersand character. We are currently researching this in detail. If you do not want to use shortcuts binding you could avoid this behavior by setting UseMnemonic property of TextPrimitive to false:

    TextPrimitive.UseMnemonic = false;  

    Please, excuse us for the inconvenience. Don't hesitate to contact us if you have other questions.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top