Avoid shortcut key in button's content

2 posts, 0 answers
  1. Thomas
    Thomas avatar
    1 posts
    Member since:
    Sep 2012

    Posted 19 Sep 2012 Link to this post

    I use a RadButton in a GridView and its content is set to a strings, that contain an underscore ('_'), e.g. 'CT_SRV_ERROR_700'.
    Instead of the given string the content of the button is shown without the first underscore, in the example as 'CTSRV_ERROR_700'.
    Pressing 'Alt' the first underscore appears as a shortcut key, that means the 'S' is underlined.

    I would like to have the content as is, that means with the first '_' shown. Shortcut keys are not necessary and not desired.
    Could you please help me?


  2. Stefan
    Stefan avatar
    89 posts

    Posted 20 Sep 2012 Link to this post

    Hello Thomas,

    In order not to have an access key you have to escape the "_" symbol in the RadButton's content. The way to escape the underscore symbol is to put another one before it. In your case you need to put double "_" on every place you want a single underscore, because if you make only the first "_" double then the content will look like 'CT_SRVERROR_700' and "E" will be the short key.

    Please give this approach a try and write us back if you have more questions.

    Kind regards,
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. DevCraft banner
Back to Top