Syncfusion.XlsIO.Base
Example 


WrapText Property (IRange)

Gets or sets wrap text of the Range.
Syntax
'Declaration
 
Property WrapText As Boolean
'Usage
 
Dim instance As IRange
Dim value As Boolean
 
instance.WrapText = value
 
value = instance.WrapText
bool WrapText {get; set;}
Remarks
While applying wraptext to rows/columns in Excel, autofit is done for rows/columns everytime when data is added. But in XlsIO, autofit of rows/columns are not done like Excel because of performance considerations. To achieve Excel behavior, the autofit can be invoked manually.
Example
The following code illustrates how to set WrapText property.
using Syncfusion.XlsIO;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Set text
            worksheet["A1"].Text = "This cell contains sample text";
            
            //Set wrap text
            worksheet["A1"].WrapText = true;
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close(); 
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also