Spread Windows Forms 12.0 Product Documentation
GetDirectName Method (DefaultSheetStyleModel)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > DefaultSheetStyleModel Class : GetDirectName Method
Model row index of the cell, or -1 to specify a column or model default
Model column index of the cell, or -1 to specify a row or model default
Gets the name of the direct style assigned to a cell, column, row, or model default.
Syntax
'Declaration
 
Public Overridable Function GetDirectName( _
   ByVal row As Integer, _
   ByVal column As Integer _
) As String
'Usage
 
Dim instance As DefaultSheetStyleModel
Dim row As Integer
Dim column As Integer
Dim value As String
 
value = instance.GetDirectName(row, column)
public virtual string GetDirectName( 
   int row,
   int column
)

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

Return Value

String containing the name of the style
Exceptions
ExceptionDescription
Specified row index is not valid; must be between -1 and the total number of rows
Specified column index is not valid; must be between -1 and the total number of columns
Remarks

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.

Example
This example sets and returns the name of the style for the specified cell.
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);
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)
See Also

Reference

DefaultSheetStyleModel Class
DefaultSheetStyleModel Members