We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Label carriage return

Thread ID:

Created:

Updated:

Platform:

Replies:

119735 Jul 27,2015 04:44 AM Aug 5,2015 11:56 PM ASP.NET Web Forms 7
loading
Tags: Diagram
Cosimo Carbonelli
Asked On July 27, 2015 04:44 AM

In version 12 I was able to force carriage return in a label inside a node. For example I used the following code to force the carriage return between Test and Carriage Return:
Label label = new Label()
label.Text = "Test/nCarriage returns";

How can I obtain the same feature on versione 13 of essential studio?
Thanks in advance.
Best regards.

Shyam G [Syncfusion]
Replied On July 28, 2015 05:31 AM

Hi Cosimo

Thanks for using Syncfusion products.

We suggest you to set label’s  property Wrapping as Wrap to achieve your requirement. if we misunderstood your requirement, could you please provide us more details such as screenshot of your requirement or describe your requirement in detail? This will help us to verify further and provide a better solution to you. please refer the code snippet below.

Code snippet:

BasicShape node = new BasicShape();

  //label creation

  Label label = new Label();

 label.Text = "Test/nCarriage returns";

  label.Wrapping = TextWrapping.Wrap;
  node.Labels.Add(label);
DiagramContent.Model.Nodes.Add(node);

Sample:http://www.syncfusion.com/downloads/support/forum/119735/ze/labelsample-1641220341

Please let me know if any concerns.

Regards,
Shyam G


Cosimo Carbonelli
Replied On July 29, 2015 04:02 AM

Hi Cosimo

Thanks for using Syncfusion products.

We suggest you to set label’s  property Wrapping as Wrap to achieve your requirement. if we misunderstood your requirement, could you please provide us more details such as screenshot of your requirement or describe your requirement in detail? This will help us to verify further and provide a better solution to you. please refer the code snippet below.

Code snippet:

BasicShape node = new BasicShape();

  //label creation

  Label label = new Label();

 label.Text = "Test/nCarriage returns";

  label.Wrapping = TextWrapping.Wrap;
  node.Labels.Add(label);
DiagramContent.Model.Nodes.Add(node);

Sample:http://www.syncfusion.com/downloads/support/forum/119735/ze/labelsample-1641220341

Please let me know if any concerns.

Regards,
Shyam G


Hi Shyam,
thank you for your answer. I've tested the sample but the result is

Instead I'd like to have
Test
Carriage returns

Best regards.


Shyam G [Syncfusion]
Replied On July 30, 2015 06:53 AM

Hi Cosimo

Thanks for your update.

We suggest you to set the label’s text as “Test\nCarriage returns to achieve your requirement. Please refer the code snippet below

Code snippet:

 BasicShape node = new BasicShape();

  //label creation

  Label label = new Label();

 label.Text = "Test\nCarriage returns";

 node.Labels.Add(label);
 DiagramContent.Model.Nodes.Add(node);

Please let me know if any concerns.

Regards,
Shyam G


Cosimo Carbonelli
Replied On July 31, 2015 03:35 AM

Hi Shyam,
the code you sent me does not work, it shows
Test\ncarriage returns
instead of
Test
carriage returns.

I try to explain bettere the problem: I have a lable inside a node, I know how to have automatic line feed in order to have the label to keep inside the node. I don't kno how to force the line feed at a specific position of the label. For example I have the text "Test carriage return", according to the size of the node I obtain
Test carriage
return
I want to obtain
Test
carriage return.

Thanks for your help.
Best regards




Shyam G [Syncfusion]
Replied On August 1, 2015 09:16 PM

Hi Cosimo

Thanks for your update.

We have created a sample to achieve your requirement and it is available in the below link for download. Please refer the video below

Sample:http://www.syncfusion.com/downloads/support/forum/119735/ze/asp.netsample22274611

Video:http://www.syncfusion.com/downloads/support/forum/119735/ze/labelvideo1317515761

Please let me know if any concerns.

Regards,
Shyam G

Cosimo Carbonelli
Replied On August 5, 2015 02:25 AM

Hi Shyam,
thank you. This solved my problem.
Best regards.

Shyam G [Syncfusion]
Replied On August 5, 2015 11:56 PM

Hi Cosimo

Thanks for your update.

Please let us know if you require further assistance on this.

Regards,
Shyam G

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;