GridCell.SetStyle

GridCell.SetStyle method

Sets style to cell. To improve performance,implement “SetStyle” method, not implement “Style” property.

public void SetStyle(Style value)
ParameterTypeDescription
styleStylestyle to be set.

Examples

[C#]
Style style = sheet.GetCell(0, 0).GetStyle();
style.CellLocked = true;
style.VAlignment = VerticalAlignmentType.Top;
...
sheet.GetCell(0, 0).SetStyle(style);

[Visual Basic]
Dim style As Style =  sheet.GetCell(0,0).GetStyle() 
style.CellLocked = True
style.VAlignment = VerticalAlignmentType.Top
...
sheet.GetCell(0, 0).SetStyle(style)

See Also