[]
        
(Showing Draft Content)

C1.Excel.XLCell.SetValue

SetValue Method

SetValue(object, XLStyle)

Sets the Value and Style properties of a cell.

Declaration
public void SetValue(object value, XLStyle style)
Parameters
Type Name Description
object value

New cell value.

XLStyle style

New cell style.

Remarks

This method allows you to set the Value and Style properties of a cell simultaneously. This can make your code more compact and easier to maintain. For example:

// set cell value and style (short version)
sheet[0,0].SetValue("Hello", styleBold);

// set cell value and style (longer version)
sheet[0,0].Value = "Hello";
sheet[0,0].Style = styleBold;