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

How to change the text indent?

4 Answers 278 Views
Label
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 25 Apr 2017, 04:35 AM

Hello,

I tried to remove the text indent of RadLabel but i couldn't.

Should I make the RadLabel's text have no any indents?

As in the attachment, I already set the margin and padding to 0

Please help me

 

Thanks,

4 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 25 Apr 2017, 10:31 AM
Hi Paul, 

You can use negative padding for this:
radLabel1.LabelElement.Padding = new Padding(-3, 0, 0, 0);

Do not hesitate to contact us if you have other questions.
 
Regards,
Dimitar
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Paul
Top achievements
Rank 1
answered on 26 Apr 2017, 03:21 AM

Hello Dimitar,

Your solution working well for me

Thanks you so much for your help

Regard,

Paull

0
özer
Top achievements
Rank 2
Veteran
Iron
answered on 21 Aug 2020, 09:53 PM

Hi Dimitar.

But what if there is text and an image at the same time?
The picture is on the left but; text should not be on the left, away from the left edge by the specified pixel. How can we do that?

0
Nadya | Tech Support Engineer
Telerik team
answered on 24 Aug 2020, 08:41 AM

Hello, özer,

According to the provided information, it seems that you have an image to the left in RadLabel. In order to distance the text from the image to specified pixels, you can set the Margin property of the TextPrimitive to the desired value:

this.radLabel1.Image = Resources.MailNew;
this.radLabel1.TextImageRelation = TextImageRelation.ImageBeforeText;
// set Margin property
this.radLabel1.LabelElement.LabelText.Margin = new Padding(55, 0, 0, 0);

I hope this helps. Let me know if you have further difficulties.

Regards,
Nadya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Label
Asked by
Paul
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Paul
Top achievements
Rank 1
özer
Top achievements
Rank 2
Veteran
Iron
Nadya | Tech Support Engineer
Telerik team
Share this question
or