FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetStyleModel Class : NamedStyles Property |
'Declaration Public Overridable Property NamedStyles As NamedStyleCollection
'Usage Dim instance As DefaultSheetStyleModel Dim value As NamedStyleCollection instance.NamedStyles = value value = instance.NamedStyles
public virtual NamedStyleCollection NamedStyles {get; set;}
When the NamedStyleCollection property is set, any named styles referenced in the model are reset to the named style in the new named styles collection with the same name, or reset to null if there is no named style in the new named styles collection with the same name.
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
Target Platforms: Windows 7, Windows 8, Windows 10, Windows Vista, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP Professional