How do I make RadButton text appear with ellipsis when too long?

4 posts, 0 answers
  1. Mark
    Mark avatar
    4 posts
    Member since:
    Mar 2012

    Posted 10 Oct 2014 Link to this post

    Let's say I have a RadButton of width 200 px.  I want the button text to be automatically shortened with an ellipsis (...) at the end if the text is too long to fit in the button width.

    How do I do that?
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 13 Oct 2014 Link to this post

    Hello Mark,

    Thank you for writing.

    This can be achieved by setting the AutoEllipsis property of the text element to true (which is also a default setting):
    radButton1.ButtonElement.TextElement.AutoEllipsis = false;

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Mark
    Mark avatar
    4 posts
    Member since:
    Mar 2012

    Posted 13 Oct 2014 in reply to Stefan Link to this post

    Thanks, but this doesn't quite do it.

    I have a RadButton with the image set and this property set:

    TextImageRelation = ImageBeforeText

    If TextImageRelation is left to the default value of Overlay, the ellipsis works, but the text overlays the image.  If I change the value to ImageBeforeText, the button text is not ellipsed.  I want the text to the right of the image AND show the ellipsed button text.
  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 14 Oct 2014 Link to this post

    Hello Mark,

    I have tested placing the image both before and after the text and the text is AutoEllipsed correctly. Please refer to the attached sample and let me know what I am missing.

    I am looking forward to your reply.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top