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

Ampersand character showing up as _

5 Answers 1050 Views
Label
This is a migrated thread and some comments may be shown as answers.
Dan Harvey
Top achievements
Rank 2
Dan Harvey asked on 01 Feb 2010, 10:17 PM
I am setting the text on a label based upon what a user types into a textbox.  Is the user types in the phrase "Dan & Co." the label will display "Dan _Co.".  How do I escape this character??

Thanks,

5 Answers, 1 is accepted

Sort by
0
Dan Harvey
Top achievements
Rank 2
answered on 04 Feb 2010, 01:11 PM
This was solved, string.replace("&","&&")
0
Nikolay
Telerik team
answered on 04 Feb 2010, 01:27 PM
Hi dan harvey,

Indeed, this is one of the options that you have.

When the UseMnemonic property is true, you need to use a second '&' if you want to display '&' instead of '_'. However, in case you do not want to place a second '&', you can just set the UseMnemonic property to false and your single '&' will be displayed as '&'.

Best wishes,
Nikolay
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Stack
Top achievements
Rank 1
answered on 08 May 2016, 09:06 AM
I got the same problm with RadPanel and i didnt found UseMnemonic property, Any alternative?
0
Stack
Top achievements
Rank 1
answered on 08 May 2016, 09:12 AM
Resolved by UseMnemonic property in TextPrimitive, Thanks!
0
Hristo
Telerik team
answered on 09 May 2016, 01:49 PM
Hi Stack,

Thank you for writing.

I am glad that you have resolved the issue.

Please let me know if you need further assistance.

Regards,
Hristo Merdjanov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Label
Asked by
Dan Harvey
Top achievements
Rank 2
Answers by
Dan Harvey
Top achievements
Rank 2
Nikolay
Telerik team
Stack
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or