SetColumnWidthInPixels(Int32,Int32) Method
Sets column width in pixels for the specified column.
Syntax
'Declaration Overloads Sub SetColumnWidthInPixels( _ ByVal iColumnIndex As Integer, _ ByVal value As Integer _ )
'Usage Dim instance As IWorksheet Dim iColumnIndex As Integer Dim value As Integer instance.SetColumnWidthInPixels(iColumnIndex, value)
void SetColumnWidthInPixels( int iColumnIndex, int value )
Parameters
- iColumnIndex
- One-based column index.
- value
- Width in pixels to set.
Example
The following code illustrates how to set width for a column.
using Syncfusion.XlsIO; class Program { static void Main() { using (ExcelEngine excelEngine = new ExcelEngine()) { //Create worksheet IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Excel2013; IWorkbook workbook = application.Workbooks.Create(1); IWorksheet worksheet = workbook.Worksheets[0]; //Set column width worksheet.SetColumnWidthInPixels(2, 160); //Save and dispose workbook.SaveAs("CellFormats.xlsx"); workbook.Close(); } } }
AssemblyVersion
Syncfusion.XlsIO.Base: 16.4460.0.52
See Also