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

Show text with ellipsis on RadStatusStrip if text does not fit

4 Answers 298 Views
StatusStrip
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 02 Sep 2016, 06:13 PM
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?

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 05 Sep 2016, 08:30 AM
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. 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.
0
Mark
Top achievements
Rank 1
answered on 06 Sep 2016, 09:11 PM
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.
0
Mark
Top achievements
Rank 1
answered on 07 Sep 2016, 10:14 PM
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.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 09 Sep 2016, 08:49 AM
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 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.
Tags
StatusStrip
Asked by
Mark
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Mark
Top achievements
Rank 1
Share this question
or