Visual Basic (Declaration) | |
---|---|
Public Overridable Sub SetDirectName( _ ByVal row As Integer, _ ByVal column As Integer, _ ByVal styleName As String _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As DefaultSheetStyleModel Dim row As Integer Dim column As Integer Dim styleName As String instance.SetDirectName(row, column, styleName) |
Parameters
- row
- Model row index of the cell, or -1 to specify a column or model default
- column
- Model column index of the cell, or -1 to specify a row or model default
- styleName
- Name of the style to set
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.
This example sets and returns the name of the style for the specified cell.
C# | Copy Code |
---|---|
FarPoint.Win.Spread.Model.DefaultSheetStyleModel defstyleModel = new FarPoint.Win.Spread.Model.DefaultSheetStyleModel(); string s; defstyleModel = (FarPoint.Win.Spread.Model.DefaultSheetStyleModel)fpSpread1.ActiveSheet.Models.Style; defstyleModel.SetDirectName(0, 0, "Style"); s = defstyleModel.GetDirectName(0, 0); listBox1.Items.Add(s); |
Visual Basic | Copy Code |
---|---|
Dim defstyleModel As New FarPoint.Win.Spread.Model.DefaultSheetStyleModel() Dim s As String defstyleModel = FpSpread1.ActiveSheet.Models.Style defstyleModel.SetDirectName(0, 0, "Style") s = defstyleModel.GetDirectName(0, 0) ListBox1.Items.Add(s) |
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2