Spread Windows Forms 6.0 Product Documentation
SheetSpanModelEventType Enumeration
Example  See Also  Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace : SheetSpanModelEventType Enumeration


Glossary Item Box

Specifies the type of Change event that has occurred for a span model for the sheet.

Syntax

Visual Basic (Declaration) 
Public Enum SheetSpanModelEventType 
   Inherits System.Enum
Visual Basic (Usage)Copy Code
Dim instance As SheetSpanModelEventType
C# 
public enum SheetSpanModelEventType : System.Enum 

Members

MemberDescription
ModelUpdatedIndicates that the entire model has changed
SpanAddedIndicates that an individual span has been added
SpanRemovedIndicates that an individual span has been removed
SpanUpdatedIndicates that an individual span has changed

Example

This example causes the Changed event to occur for the SheetSpanModel and the type for the event is returned to a list box.
C#Copy Code
FarPoint.Win.Spread.Model.DefaultSheetSpanModel spanModel = new FarPoint.Win.Spread.Model.DefaultSheetSpanModel();

private void Form1_Load(object sender, System.EventArgs e)
{
    fpSpread1.ActiveSheet.Models.Span = spanModel;
    this.spanModel.Changed += new FarPoint.Win.Spread.Model.SheetSpanModelEventHandler(this.spanModel_Changed);
}

private void menuItem1_Click(object sender, System.EventArgs e)
{
    fpSpread1.ActiveSheet.Models.Span = spanModel;
    spanModel.Add(0, 0, 3, 3);
}

private void spanModel_Changed(object sender, FarPoint.Win.Spread.Model.SheetSpanModelEventArgs e)
{
    switch (e.Type)
    {
        case FarPoint.Win.Spread.Model.SheetSpanModelEventType.SpanAdded:
            listBox1.Items.Add(e.Type.ToString());
            break;
        case FarPoint.Win.Spread.Model.SheetSpanModelEventType.SpanRemoved:
            listBox1.Items.Add(e.Type.ToString());
            break;
        case FarPoint.Win.Spread.Model.SheetSpanModelEventType.SpanUpdated:
            listBox1.Items.Add(e.Type.ToString());
            break;
        case FarPoint.Win.Spread.Model.SheetSpanModelEventType.ModelUpdated:
            listBox1.Items.Add(e.Type.ToString());
            break;
    }
}
Visual BasicCopy Code
Friend WithEvents spanModel As New FarPoint.Win.Spread.Model.DefaultSheetSpanModel()

Private Sub MenuItem38_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem38.Click
FpSpread1.ActiveSheet.Models.Span = spanModel
spanModel.Add(0, 0, 3, 3)
End Sub

Private Sub spanModel_Changed(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.Model.SheetSpanModelEventArgs) Handles
spanModel.Changed
Select Case e.Type
    Case FarPoint.Win.Spread.Model.SheetSpanModelEventType.SpanAdded
        ListBox1.Items.Add(e.Type.ToString())
    Case FarPoint.Win.Spread.Model.SheetSpanModelEventType.SpanRemoved
        ListBox1.Items.Add(e.Type.ToString())
    Case FarPoint.Win.Spread.Model.SheetSpanModelEventType.SpanUpdated
        ListBox1.Items.Add(e.Type.ToString())
    Case FarPoint.Win.Spread.Model.SheetSpanModelEventType.ModelUpdated
        ListBox1.Items.Add(e.Type.ToString())
End Select
End Sub

Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         FarPoint.Win.Spread.Model.SheetSpanModelEventType

Requirements

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

See Also

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