Syncfusion.XlsIO.Base
Example 


ColumnWidth Property (IRange)

Gets or sets the width of all columns in the specified range, measured in points.
Syntax
'Declaration
 
Property ColumnWidth As Double
'Usage
 
Dim instance As IRange
Dim value As Double
 
instance.ColumnWidth = value
 
value = instance.ColumnWidth
double ColumnWidth {get; set;}
Remarks
Gets Double.MinValue if the rows in the specified Range aren't all the same width.
Example
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 column width
            worksheet["A1"].ColumnWidth = 25;
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close(); 
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also