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

radButton tooltip

3 Answers 144 Views
Button
This is a migrated thread and some comments may be shown as answers.
Pardha Saradhi
Top achievements
Rank 1
Pardha Saradhi asked on 07 Feb 2011, 11:47 AM
Hi,

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.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Feb 2011, 06:50 AM
Hello,

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

C#:
protected void Page_Load(object sender, EventArgs e)
   {
       RadButton1.ToolTip = RadButton1.Text;
       if (RadButton1.Text.Length > 5)
       {
           RadButton1.Text = RadButton1.Text.Substring(0, 5);
           RadButton1.Text+="...";
       }
   }

Thanks,
Shinu.
0
Pardha Saradhi
Top achievements
Rank 1
answered on 08 Feb 2011, 08:43 AM
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.
0
Pero
Telerik team
answered on 09 Feb 2011, 02:18 PM
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,
Pero
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.
Tags
Button
Asked by
Pardha Saradhi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Pardha Saradhi
Top achievements
Rank 1
Pero
Telerik team
Share this question
or