FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetStyleModel Class : SetDirectName Method |
'Declaration Public Overridable Sub SetDirectName( _ ByVal row As Integer, _ ByVal column As Integer, _ ByVal styleName As String _ )
'Usage Dim instance As DefaultSheetStyleModel Dim row As Integer Dim column As Integer Dim styleName As String instance.SetDirectName(row, column, styleName)
Exception | Description |
---|---|
System.IndexOutOfRangeException | Specified row index is not valid; must be between -1 and the total number of rows |
System.IndexOutOfRangeException | Specified column index is not valid; must be between -1 and the total number of columns |
Direct cell styles override direct row styles, which override direct column styles, which override model default styles. Direct row styles use -1 for the column, direct column styles use -1 for the row, and model default styles use -1 for both the row and column.
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(); style.Name="YellowCell"; style.BackColor=Color.Yellow; FpSpread1.NamedStyles.Add(style); model.SetDirectName(0,0,"YellowCell"); ListBox1.Items.Add(model.GetDirectName(0,0)); }
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() style.Name="YellowCell" style.BackColor=Color.Yellow FpSpread1.NamedStyles.Add(style) model.SetDirectName(0,0,"YellowCell") ListBox1.Items.Add(model.GetDirectName(0,0)) End Sub
Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6