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. Image for the cookie policy date

Label carriage return

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.

7 Replies

SG Shyam G Syncfusion Team July 28, 2015 09:31 AM UTC

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



CC Cosimo Carbonelli replied to Shyam G July 29, 2015 08:02 AM UTC

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.



SG Shyam G Syncfusion Team July 30, 2015 10:53 AM UTC

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



CC Cosimo Carbonelli July 31, 2015 07:35 AM UTC

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





SG Shyam G Syncfusion Team August 2, 2015 01:16 AM UTC

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


CC Cosimo Carbonelli August 5, 2015 06:25 AM UTC

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


SG Shyam G Syncfusion Team August 6, 2015 03:56 AM UTC

Hi Cosimo

Thanks for your update.

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

Regards,
Shyam G

Loader.
Up arrow icon