Spread Windows Forms 12.0 Product Documentation
SheetStyleModelEventType Enumeration
Example Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace : SheetStyleModelEventType Enumeration
Specifies the type of Change event that has occurred for a style model for the sheet.
Syntax
'Declaration
 
Public Enum SheetStyleModelEventType 
   Inherits System.Enum
'Usage
 
Dim instance As SheetStyleModelEventType
public enum SheetStyleModelEventType : System.Enum 
Members
MemberDescription
CellsUpdatedIndicates that the style of one or more cells has changed
ColumnsAddedIndicates that the style of one or more columns has been added
ColumnsRemovedIndicates that the style of one or more columns has been removed
ModelUpdatedIndicates that the model has been updated such that all styles may have changed
RowsAddedIndicates that the style of one or more rows has been added
RowsRemovedIndicates that the style of one or more rows has been removed
Example
This example causes the Changed event to occur for the SheetStyleModel and the type for the event is returned to a list box.
FarPoint.Win.Spread.Model.DefaultSheetStyleModel styleModel = new FarPoint.Win.Spread.Model.DefaultSheetStyleModel();

private void Form1_Load(object sender, System.EventArgs e)
{
    styleModel = (FarPoint.Win.Spread.Model.DefaultSheetStyleModel)fpSpread1.ActiveSheet.Models.Style;
    this.styleModel.Changed += new FarPoint.Win.Spread.Model.SheetStyleModelEventHandler(this.styleModel_Changed);
}

private void menuItem1_Click(object sender, System.EventArgs e)
{
    styleModel = (FarPoint.Win.Spread.Model.DefaultSheetStyleModel)fpSpread1.ActiveSheet.Models.Style;
    styleModel.AltRowCount = 3;
}

private void styleModel_Changed(object sender, FarPoint.Win.Spread.Model.SheetStyleModelEventArgs e)
{
    switch (e.Type)
    {
        case FarPoint.Win.Spread.Model.SheetStyleModelEventType.CellsUpdated:
            listBox1.Items.Add(e.Type.ToString());
            break;
        case FarPoint.Win.Spread.Model.SheetStyleModelEventType.RowsAdded:
            listBox1.Items.Add(e.Type.ToString());
            break;
        case FarPoint.Win.Spread.Model.SheetStyleModelEventType.RowsRemoved:
            listBox1.Items.Add(e.Type.ToString());
            break;
        case FarPoint.Win.Spread.Model.SheetStyleModelEventType.ColumnsAdded:
            listBox1.Items.Add(e.Type.ToString());
            break;
        case FarPoint.Win.Spread.Model.SheetStyleModelEventType.ColumnsRemoved:
            listBox1.Items.Add(e.Type.ToString());
            break;
        case FarPoint.Win.Spread.Model.SheetStyleModelEventType.ModelUpdated:
            listBox1.Items.Add(e.Type.ToString());
            break;
    }
}
Friend WithEvents styleModel As New FarPoint.Win.Spread.Model.DefaultSheetStyleModel()

Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
    styleModel = FpSpread1.ActiveSheet.Models.Style
    styleModel.AltRowCount = 3
End Sub

Private Sub styleModel_Changed(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.Model.SheetStyleModelEventArgs) Handles
styleModel.Changed
Select Case e.Type
    Case FarPoint.Win.Spread.Model.SheetStyleModelEventType.CellsUpdated
        ListBox1.Items.Add(e.Type.ToString())
    Case FarPoint.Win.Spread.Model.SheetStyleModelEventType.RowsAdded
        ListBox1.Items.Add(e.Type.ToString())
    Case FarPoint.Win.Spread.Model.SheetStyleModelEventType.RowsRemoved
        ListBox1.Items.Add(e.Type.ToString())
    Case FarPoint.Win.Spread.Model.SheetStyleModelEventType.ColumnsAdded
        ListBox1.Items.Add(e.Type.ToString())
    Case FarPoint.Win.Spread.Model.SheetStyleModelEventType.ColumnsRemoved
        ListBox1.Items.Add(e.Type.ToString())
    Case FarPoint.Win.Spread.Model.SheetStyleModelEventType.ModelUpdated
        ListBox1.Items.Add(e.Type.ToString())
End Select
End Sub
Inheritance Hierarchy

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

See Also

Reference

FarPoint.Win.Spread.Model Namespace