Spread for ASP.NET 7.0 Product Documentation
Parent Property
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetAxisModel Class : Parent Property


Glossary Item Box

Gets or sets the parent sheet axis model.

Syntax

Visual Basic (Declaration) 
Public Property Parent As ISheetAxisModel
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetAxisModel
Dim value As ISheetAxisModel
 
instance.Parent = value
 
value = instance.Parent
C# 
public ISheetAxisModel Parent {get; set;}

Property Value

ISheetAxisModel object with the parent sheet axis model

Example

This example creates a new DefaultSheetAxisModel based on an overridden one and assigns it to the spreadsheets ColumnAxisModel.
Visual BasicCopy Code
Public Class mySheetAxisModel
Inherits FarPoint.Web.Spread.Model.DefaultSheetAxisModel

Dim size As Integer=180

Public Overrides Function GetSize(ByVal index As Integer)As Integer
Return size
End Function

Public Overrides Sub SetSize(ByVal index As Integer,ByVal value As Integer)
value=size
End Sub

End Class

Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load

If(Me.IsPostBack)Then Return

Dim isheet As New mySheetAxisModel()
Dim model As New FarPoint.Web.Spread.Model.DefaultSheetAxisModel(FpSpread1.ActiveSheetView.ColumnCount,FarPoint.Web.Spread.Model.SheetAxisOrientation.Horizontal,isheet)
FpSpread1.ActiveSheetView.ColumnAxisModel=model
End Sub
C#Copy Code
public class mySheetAxisModel:FarPoint.Web.Spread.Model.DefaultSheetAxisModel
{
private int i=180;
private bool b=false;

public override int GetSize(int index)
{
return i;
}

public override void SetSize(int index,int value)
{
i=value;
}
}

private void Page_Load(object sender,System.EventArgs e)
{
if(this.IsPostBack)return;

mySheetAxisModel isheet=new mySheetAxisModel();
FarPoint.Web.Spread.Model.DefaultSheetAxisMode lmodel=new FarPoint.Web.Spread.Model.DefaultSheetAxisModel(FpSpread1.ActiveSheetView.ColumnCount,FarPoint.Web.Spread.Model.SheetAxisOrientation.Horizontal);
model.Parent=isheet;
FpSpread1.ActiveSheetView.ColumnAxisModel=model;
}

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.