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

Proper way to add text to waitbar with radlabel.

1 Answer 78 Views
WaitingBar
This is a migrated thread and some comments may be shown as answers.
Jose Mejia
Top achievements
Rank 1
Jose Mejia asked on 21 Jul 2010, 11:17 AM
Hello.

I know that there is no (for now) possibility to add text to waitingbar so I did some workaround for this:

var label = new RadLabel();
label.Text = "some test";
label.TextAlignment = ContentAlignment.MiddleRight;
 
 
waitingBar.EnableTheming = true;
waitingBar.RootElement.ElementTree.ThemeName = "Breeze";
waitingBar.WaitingBarElement.Value = 0;
waitingBar.Controls.Add(label);

But it looks ugly and also waitingbarelement is mostly hidden by the text.
Maybe I'm doing something wrong? Maybe there is better workaround.

thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Vasilev
Telerik team
answered on 26 Jul 2010, 02:55 PM
Hi Jose Mejia,

Thank you for writing.

Actually, it would be better if you add a TextPrimitive element instead RadLabel control. Please consider the following code:
TextPrimitive textElement = new TextPrimitive();
textElement.Text = this.radWaitingBar1.Name;
textElement.Alignment = ContentAlignment.MiddleCenter;
textElement.ZIndex = 100;
this.radWaitingBar1.WaitingBarElement.Children.Add(textElement);

I hope this helps. Let me know if you have any additional questions.

Best wishes,
Martin Vasilev
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
Tags
WaitingBar
Asked by
Jose Mejia
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or