private void Page_Load(object sender,System.EventArgs e)
{
if(this.IsPostBack)return;
FarPoint.Web.Spread.Model.DefaultSheetStyleModel model=(FarPoint.Web.Spread.Model.DefaultSheetStyleModel)FpSpread1.Sheets[0].StyleModel;
FarPoint.Web.Spread.NamedStyle style=new FarPoint.Web.Spread.NamedStyle("Yellow");
style.BackColor=Color.Yellow;
FpSpread1.NamedStyles.Add(style);
FarPoint.Web.Spread.NamedStyle style1=new FarPoint.Web.Spread.NamedStyle("Red");
style1.BackColor=Color.Red;
FpSpread1.NamedStyles.Add(style1);
model.SetDirectName(0,0,"Yellow");
model.SetDirectName(0,2,"Red");
ListBox1.Items.Add(model.NamedStyles.Count.ToString());
}
Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load
If(IsPostBack)Then Return
Dim model As FarPoint.Web.Spread.Model.DefaultSheetStyleModel=FpSpread1.Sheets(0).StyleModel
Dim style As New FarPoint.Web.Spread.NamedStyle("Yellow")
style.BackColor=Color.Yellow
FpSpread1.NamedStyles.Add(style)
Dim style1 As New FarPoint.Web.Spread.NamedStyle("Red")
style1.BackColor=Color.Red
FpSpread1.NamedStyles.Add(style1)
model.SetDirectName(0,0,"Yellow")
model.SetDirectName(0,2,"Red")
ListBox1.Items.Add(model.NamedStyles.Count.ToString())
End Sub