Spread for ASP.NET 7.0 Product Documentation
GetDirectInfo Method
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetStyleModel Class : GetDirectInfo Method


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
destInfo
StyleInfo object to use for getting the style

Glossary Item Box

Gets the direct style for the specified cell, column, row, or model default.

Syntax

Visual Basic (Declaration) 
Public Overrides Function GetDirectInfo( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal destInfo As StyleInfo _
) As StyleInfo
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetStyleModel
Dim row As Integer
Dim column As Integer
Dim destInfo As StyleInfo
Dim value As StyleInfo
 
value = instance.GetDirectInfo(row, column, destInfo)
C# 
public override StyleInfo GetDirectInfo( 
   int row,
   int column,
   StyleInfo destInfo
)

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
destInfo
StyleInfo object to use for getting the style

Return Value

StyleInfo object containing the style settings

Exceptions

ExceptionDescription
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

Remarks

Spread uses a composite of style settings to paint the spreadsheet. For example, for a cell, the component looks at the style settings for the column and row for the cell, and the cell's own settings.

Use this method to get the direct settings for the specified object. Use the SetDirectInfo methods to set the direct settings for an object.

Direct cell styles override direct row styles, which override direct column styles, which override model default styles.

To return the composite information for an object, use the GetCompositeInfo method.

Example

This example creates a new StyleInfo object. The background color of the StyleInfo is set to yellow. The value from the GetDirectInfo method is returned to a list box.
C#Copy Code
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.StyleInfostyle=newFarPoint.Web.Spread.StyleInfo();
style.BackColor=Color.Yellow;

model.SetDirectInfo(0,0,style);
ListBox1.Items.Add(model.GetDirectInfo(0,0,style).BackColor.ToString());
}
Visual BasicCopy Code
Private Sub Page_Load(ByVal sender As System.Object,ByVal e AsSystem.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.StyleInfo()
style.BackColor=Color.Yellow

model.SetDirectInfo(0,0,style)
ListBox1.Items.Add(model.GetDirectInfo(0,0,style).BackColor.ToString())
End Sub

Requirements

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

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.