how to display .... at the end of the textblock when content exceeds the maximum width

4 posts, 0 answers
  1. Ravi
    Ravi avatar
    97 posts
    Member since:
    Jun 2012

    Posted 08 May 2013 Link to this post

    Hi There,

    I have a requirement where i have to display ... at the end of the text of textblock when the content exceeds maximum limit, i have tried many ways but i am unable to get the solution, i thought you are also faced the same problem in your development, so you may have the better solution, can you please tell me how we can do this?

    Regards,
    Srinivas.
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 08 May 2013 Link to this post

    Hi Srinivas,

    In order to display "...", you should set the TextTrimming property for the TextBlock. For example: 

    <TextBlock TextTrimming="CharacterEllipsis" Text="{Binding Value}"/>

    All the best,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Ravi
    Ravi avatar
    97 posts
    Member since:
    Jun 2012

    Posted 08 May 2013 Link to this post

    Hi Didie,

    Thanks for reply,

    i want to display this in silverlight textblock, may be you are thought about the WPF. i dont see this in the Silverlight, please see the attached image.

    is there any way that i can display the ellipses in the silverlight textblock?

    I appreciate for your help.

    Regards,
    Srinivas.
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 09 May 2013 Link to this post

    Hello,

    You are right.
    In that case you can use WordEllipsis:

    <telerik:GridViewDataColumn.CellTemplate>
      <DataTemplate>
        <TextBlock TextTrimming="WordEllipsis" Text="{Binding Name}"/>
      </DataTemplate>
    </telerik:GridViewDataColumn.CellTemplate>
     

    Greetings,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top