Spread Windows Forms 12.0 Product Documentation
RangeGroupStateChanging Event
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > FpSpread Class : RangeGroupStateChanging Event
Occurs before the user changes the state of row or column outlines (range group).
Syntax
'Declaration
 
Public Event RangeGroupStateChanging As RangeGroupStateChangingEventHandler
'Usage
 
Dim instance As FpSpread
Dim handler As RangeGroupStateChangingEventHandler
 
AddHandler instance.RangeGroupStateChanging, handler
public event RangeGroupStateChangingEventHandler RangeGroupStateChanging
Event Data

The event handler receives an argument of type RangeGroupStateChangingEventArgs containing data related to this event. The following RangeGroupStateChangingEventArgs properties provide information specific to this event.

PropertyDescription
(Inherited from System.ComponentModel.CancelEventArgs)
Gets whether the outline (range group) is a group of rows.  
Gets the infomation about the outline (range group) whose state was changed.  
Gets the view that contains the outline (range group) whose state is changing.  
Example
This example uses the RangeGroupStateChanging event.
fpSpread1.ActiveSheet.Rows.Count = 11;
fpSpread1.ActiveSheet.Columns.Count = 6;
FarPoint.Win.Spread.EnhancedInterfaceRenderer outlinelook = new FarPoint.Win.Spread.EnhancedInterfaceRenderer();
outlinelook.RangeGroupBackgroundColor = Color.LightGreen;
outlinelook.RangeGroupButtonBorderColor = Color.Red;
outlinelook.RangeGroupLineColor = Color.Blue;
fpSpread1.InterfaceRenderer = outlinelook;
fpSpread1.ActiveSheet.AddRangeGroup(0, 8, true);
fpSpread1.ActiveSheet.AddRangeGroup(0, 5, true);
fpSpread1.ActiveSheet.AddRangeGroup(1, 3, false);
fpSpread1.ActiveSheet.AddRangeGroup(1, 2, false);

 private void fpSpread1_RangeGroupStateChanged(object sender, FarPoint.Win.Spread.RangeGroupStateChangedEventArgs e)
        {
            listBox1.Items.Add("Changed");
        }

        private void fpSpread1_RangeGroupStateChanging(object sender, FarPoint.Win.Spread.RangeGroupStateChangingEventArgs e)
        {
            listBox1.Items.Add("Changing");
        }
fpSpread1.ActiveSheet.Rows.Count = 11
fpSpread1.ActiveSheet.Columns.Count = 6
Dim outlinelook As New FarPoint.Win.Spread.EnhancedInterfaceRenderer
outlinelook.RangeGroupBackgroundColor = Color.LightGreen
outlinelook.RangeGroupButtonBorderColor = Color.Red
outlinelook.RangeGroupLineColor = Color.Blue
fpSpread1.InterfaceRenderer = outlinelook
fpSpread1.ActiveSheet.AddRangeGroup(0, 8, True)
fpSpread1.ActiveSheet.AddRangeGroup(0, 5, True)
fpSpread1.ActiveSheet.AddRangeGroup(1, 3, False)
fpSpread1.ActiveSheet.AddRangeGroup(1, 2, False)

Private Sub fpSpread1_RangeGroupStateChanged(sender As Object, e As FarPoint.Win.Spread.RangeGroupStateChangedEventArgs) Handles fpSpread1.RangeGroupStateChanged
        ListBox1.Items.Add("Changed")
    End Sub

    Private Sub fpSpread1_RangeGroupStateChanging(sender As Object, e As FarPoint.Win.Spread.RangeGroupStateChangingEventArgs) Handles fpSpread1.RangeGroupStateChanging
        ListBox1.Items.Add("Changing")
    End Sub
See Also