FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > ISheetStyleModel Interface : GetDirectInfo Method |
'Declaration Function GetDirectInfo( _ ByVal row As Integer, _ ByVal column As Integer, _ ByVal destInfo As StyleInfo _ ) As StyleInfo
'Usage Dim instance As ISheetStyleModel Dim row As Integer Dim column As Integer Dim destInfo As StyleInfo Dim value As StyleInfo value = instance.GetDirectInfo(row, column, destInfo)
"Direct" in the style model means "not composite" or "not inherited." This method, GetDirectInfo, returns the style properties that have been set for the specified cell, column, or row directly and does not return any settings that are set for higher levels (like the entire model), while GetCompositeInfo returns the style properties "composed" or "merged" into one StyleInfo object that contains all the settings to paint and edit the cell, column, or row, including inherited settings.
Alternating row styles are not included in this method.GetDirectAltRowInfo returns the alternating row style information.
If destInfo is null, then a new StyleInfo object is created and used.
In terms of precedence of styles, direct cell styles override direct row styles, which override direct column styles, which override model default styles.
In terms of allowed values, for a direct row style, use -1 for the entire column; for a direct column style, use -1 for the entire row; and for a model default style, use -1 for all the rows and columns.
FarPoint.Win.Spread.Model.ISheetStyleModel ssm; FarPoint.Win.Spread.NamedStyle ns = new FarPoint.Win.Spread.NamedStyle("StyleData"); FarPoint.Win.Spread.StyleInfo si; ssm = (FarPoint.Win.Spread.Model.ISheetStyleModel)fpSpread1.ActiveSheet.Models.Style; ns.BackColor = Color.Yellow; fpSpread1.NamedStyles.Add(ns); ssm.SetDirectInfo(0, 0, ns); si = ssm.GetDirectInfo(0, 0, null); label1.Text = "The background color of the first cell is " + si.BackColor.ToString();
Dim ssm As FarPoint.Win.Spread.Model.ISheetStyleModel Dim ns As New FarPoint.Win.Spread.NamedStyle("StyleData") Dim si As FarPoint.Win.Spread.StyleInfo ssm = FpSpread1.ActiveSheet.Models.Style ns.BackColor = Color.Yellow FpSpread1.NamedStyles.Add(ns) ssm.SetDirectInfo(0, 0, ns) si = ssm.GetDirectInfo(0, 0, Nothing) Label1.Text = "The background color of the first cell is " & si.BackColor.ToString()
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10