This is a migrated thread and some comments may be shown as answers.

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

1 Answer 46 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 2
Michael asked on 21 Apr 2009, 11:21 PM
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.

1 Answer, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 22 Apr 2009, 07:27 AM
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.

Greetings,
Peter
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.
Tags
General Discussions
Asked by
Michael
Top achievements
Rank 2
Answers by
Peter
Telerik team
Share this question
or