Is there a way to add a carriage return\line feed (like an Alt+Enter) in an Excel cell value?
1 Answer, 1 is accepted
2
Svilen
Telerik team
answered on 28 Mar 2022, 10:28 AM
Hi, Jon,
Svilen here, I will be glad to help out with this question.
You can add new lines using \n and \r as you usually do in C#. You might notice, however, that if you simply do that the cell text in the output file still shows on one line until you double-click the cell. This is due to the fact that using "Alt+Enter" in Excel not only adds a new line but also automatically wraps the text. This helps visualize the new line and can manually be done by selecting a cell then checking the "Format Cells > Alignment tab > Wrap text" checkbox in Excel.
You can mirror this in SpreadProcessing by setting the cell's IsWrapped property to true. Here is a short code snippet, which does this:
Please let me know if I can further help and have a great day.
Regards,
Svilen
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/.