radButton tooltip

4 posts, 0 answers
  1. Pardha Saradhi
    Pardha Saradhi avatar
    28 posts
    Member since:
    Jul 2010

    Posted 07 Feb 2011 Link to this post


    My module is having one radbutton which is fixed width, but radbutton text need to be changed based on culture, so the text for one country might not be equal to another country, so in this case if radbutton text is not able to fit in the radbutton width, then i want to display  "..." (3 dots) at the end of the radbutton text and i want to display the complete text using radbutton tooltip.
    so please provide me the better solution to resovle this issue.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Feb 2011 Link to this post


    You can try the following approach to achieve the desired functionality.

    protected void Page_Load(object sender, EventArgs e)
           RadButton1.ToolTip = RadButton1.Text;
           if (RadButton1.Text.Length > 5)
               RadButton1.Text = RadButton1.Text.Substring(0, 5);

  3. Pardha Saradhi
    Pardha Saradhi avatar
    28 posts
    Member since:
    Jul 2010

    Posted 08 Feb 2011 Link to this post

    Hi Shinu,

    Thanks for your reply.

    But    RadButton1.Text.Length > 5, when we take width of english 5 characters is not equal to other country width of 5 characters.

    for ex:-  welcome in US-english language and welcome in chinese Traditional translated word(i am unable to send translated word here)
    The above given words having different length, taking different widht.
    so how do i measure the string length, in this case.
  4. Pero
    Pero avatar
    1156 posts

    Posted 09 Feb 2011 Link to this post

    Hi Pardha,

    I suppose you can check the current Culture (or UICulture) and then decide how many characters you will show on the button (i.e. if it is Chinese show 3 characters, instead of 5). The following blog post (don't miss the comments) shows some ways to get the preferred culture of the browser: http://weblogs.asp.net/emilstoichev/archive/2008/01/21/tip-how-to-get-the-client-culture-from-an-asp-net-app.aspx.

    All the best,
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top