Show text with ellipsis on RadStatusStrip if text does not fit

5 posts, 0 answers
  1. Mark
    Mark avatar
    7 posts
    Member since:
    Mar 2015

    Posted 02 Sep Link to this post

    I have a RadStatusStrip at the bottom of a form.  The RadStatusStrip contains a RadLabelElement which has text in it.  If the form is resized such that the text does not fit in the status strip, the text completely disappears.  How do I make the label text appear shortened with an ellipsis, or just shortened to fit?
  2. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 05 Sep Link to this post

    Hello Mark,

    Thank you for writing.  
     
    The RadStatusStrip.LayoutStyle property handles the arrangement of items when they exceed the horizontal space in the status bar. The default value is RadStatusBarLayoutStyle.Stack which arranges items from left to right and the rightmost items that exceed the horizontal space are not visible. In order to achieve your goal, it is necessary to set the LayoutStyle property to RadStatusBarLayoutStyle.Overflow:
    this.radLabelElement1.Text = "Once upon a time there was a very long text in a label";
    this.radLabelElement1.LabelText.AutoEllipsis = true;
    this.radLabelElement1.TextWrap = false;
    this.radStatusStrip1.LayoutStyle = Telerik.WinControls.UI.RadStatusBarLayoutStyle.Overflow;

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Mark
    Mark avatar
    7 posts
    Member since:
    Mar 2015

    Posted 06 Sep Link to this post

    That worked!  Now I need to get it to work with a RadWaitingBarElement to the left of the RadLabelElement?  If I simply add the RadWaitingBarElement on the left and set its Visibility to Visible, the RadLabelElement appears below the RadWaitingBarElement instead of to the right of it when the text of the label is too large to fit.
  5. Mark
    Mark avatar
    7 posts
    Member since:
    Mar 2015

    Posted 07 Sep in reply to Dess Link to this post

    That worked!  But now I need to get it to work with a RadWaitingBarElement to the left of the RadLabelElement?  If I simply add the RadWaitingBarElement on the left and set its Visibility to Visible, the RadLabelElement appears below the RadWaitingBarElement instead of to the right of it when the text of the label is too large to fit.
  6. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 09 Sep Link to this post

    Hello Mark, 

    Thank you for writing back. 

    This is desired behavior for the RadStatusBarLayoutStyle.Overflow. It moves items in excess of the horizontal space to the following line. The other available option is RadStatusBarLayoutStyle.Stack. However, I think it is not appropriate for your case because the element is going to be hidden if the space is not enough.

    I hope this information helps. If you have any additional questions, please let me know.

    Regards,
    Dess
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Back to Top
UI for WinForms is Visual Studio 2017 Ready