Spread for ASP.NET 11 Product Documentation
CssClass Property (LabelCellType)
Example 


FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > LabelCellType Class : CssClass Property
Gets or sets the CSS class name.
Syntax
'Declaration
 
Public Property CssClass As String
'Usage
 
Dim instance As LabelCellType
Dim value As String
 
instance.CssClass = value
 
value = instance.CssClass
public string CssClass {get; set;}

Property Value

String containing the CSS class name
Remarks

This is the name of the cascading style sheet (CSS) class.

If you set this property of a cell type and apply that cell type to a cell, Spread outputs the CssClass property as the CSS class name for the cell and outputs any style settings as the inline style. So, if you use this property, it is better to remove any other custom style settings for the cell.

The CSS Class should be outside the head tag and after the Spread HTML code for best results with strict compliance.

Example
<style>.CssStyle1 
{ 
    FONT: 700 12pt verdana; COLOR: yellow 
}
</style>

FarPoint.Web.Spread.LabelCellType lblcell = new FarPoint.Web.Spread.LabelCellType();
lblcell.AllowWrap = true;
int i = 100;
string fstring = i.ToString("C");
lblcell.FormatString = fstring;
lblcell.CssClass = "CssStyle1";
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = lblcell;
FpSpread1.ActiveSheetView.Cells[0, 0].Text = fstring;
<style>.CssStyle1 
{ 
    FONT: 700 12pt verdana; COLOR: yellow 
}
</style>

Dim lblcell As New FarPoint.Web.Spread.LabelCellType()
lblcell.AllowWrap = True
Dim i As Integer = 100
Dim fstring As String = i.ToString("C")
lblcell.FormatString = fstring
lblcell.CssClass = "CssStyle1"
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = lblcell
FpSpread1.ActiveSheetView.Cells(0, 0).Text = fstring
See Also

Reference

LabelCellType Class
LabelCellType Members