Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > MaskedTextBox > Truncatable Text Block

Not answered Truncatable Text Block

Feed from this thread
  • Ganesh Jagdale avatar

    Posted on May 3, 2011 (permalink)

    HI Telerik,
     Is There any control or way available to show Text in Text Block as "This is text..." if text which is binding is bigger than width if TextBlock.
    I have implemented the same one but it works for small text with following way..

     

     

    while (textBlockElement.ActualWidth > maxWidth && truncateText.Length > 0)

     

     

    {

     

    truncateText = truncateText.Substring(0, truncateText.Length - 1);

     

    textBlockElement.Text = truncateText +

     

    "...";

     

     

    }


    in

    TextBlock_SizeChanged Event..

    Please let me know ur team have other solution ..

    Thanks In Advance..

    Thanks,
     Ganesh

      

    Reply

  • Alex Fidanov Alex Fidanov admin's avatar

    Posted on May 5, 2011 (permalink)

    Hi Ganesh Jagdale,

    The TextBlock has this functionality out of the box. What you need is to set the TextWrapping property and a Width of the TextBlock so that it can wrap the text:

    <TextBlock Text="123456890" Width="50" TextTrimming="WordEllipsis" />

    Regards,
    Alex Fidanov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Ganesh Jagdale avatar

    Posted on May 5, 2011 (permalink)

    Thanks a lot for your reply.
     that's very good property available. 

    Reply

  • Jason avatar

    Posted on Nov 14, 2011 (permalink)

    the problem with switching over to TextBlock is that if you are using Telerik Themes, the TextBlock is not themed correctly.

    can you tell me how to carry Telerik's themes to the TextBlock control?

    Regards,
    Jason

    Reply

  • Petar Mladenov Petar Mladenov admin's avatar

    Posted on Nov 17, 2011 (permalink)

    Hello Jason,

     Telerik themes can be applied to non telerik controls but not all controls have defined styles in our themes. You can use our styles with: Button, ScrollBar, ScrollViewer, ListBox, CheckBox and RadioButton. I think there are no other non-Telerik styles.
    We haven't created themes for TextBlock or Label since they can be fully customized through Properties (Foreground, FontSize etc.) and their default values usually fit well with our themes.

    All the best,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > MaskedTextBox > Truncatable Text Block
Related resources for "Truncatable Text Block"

Silverlight MaskedTextBox Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]