Spread WPF 15
GrapeCity.Windows.SpreadSheet.Data Namespace / RangeGroup Class / Group Method
The group starting index.
The number of rows or columns to group.

In This Topic
    Group Method
    In This Topic
    Groups a range of rows or columns into an outline (range group) from a specified start index using a specified amount.
    Public Sub Group( _
       ByVal index As Integer, _
       ByVal count As Integer _
    Dim instance As RangeGroup
    Dim index As Integer
    Dim count As Integer
    instance.Group(index, count)
    public void Group( 
       int index,
       int count


    The group starting index.
    The number of rows or columns to group.
    This example uses the Group method.
    gcSpreadSheet1.Sheets[0].ColumnCount = 7;
    gcSpreadSheet1.Sheets[0].RowCount = 34;
    gcSpreadSheet1.Sheets[0].Cells[0, 0].Text = "Western";
    gcSpreadSheet1.Sheets[0].Cells[0, 1].Text = "Western";
    gcSpreadSheet1.Sheets[0].Cells[0, 2].Text = "Western";
    gcSpreadSheet1.Sheets[0].Cells[1, 0].Text = "A";
    gcSpreadSheet1.Sheets[0].Cells[1, 1].Text = "B";
    gcSpreadSheet1.Sheets[0].Cells[1, 2].Text = "C";
    gcSpreadSheet1.Sheets[0].Cells[2, 0].Text = "A";
    gcSpreadSheet1.Sheets[0].Cells[2, 1].Text = "B";
    gcSpreadSheet1.Sheets[0].Cells[2, 2].Text = "C";
    gcSpreadSheet1.Sheets[0].RowRangeGroup.Group(0, 2);
    //The following code removes the row range group
    //gcSpreadSheet1.Sheets[0].RowRangeGroup.Ungroup(0, 2);
    gcSpreadSheet1.Sheets[0].ColumnRangeGroup.Group(0, 1);
    //The following code removes the column range group
    //gcSpreadSheet1.Sheets[0].ColumnRangeGroup.Ungroup(0, 1);      
    private void button1_Click(object sender, RoutedEventArgs e)
    gcSpreadSheet1.Sheets[0].RowRangeGroup.Expand(0, false);
    gcSpreadSheet1.Sheets[0].ColumnRangeGroup.Expand(0, false);
    GcSpreadSheet1.Sheets(0).ColumnCount = 7
    GcSpreadSheet1.Sheets(0).RowCount = 34
    GcSpreadSheet1.Sheets(0).Cells(0, 0).Text = "Western"
    GcSpreadSheet1.Sheets(0).Cells(0, 1).Text = "Western"
    GcSpreadSheet1.Sheets(0).Cells(0, 2).Text = "Western"
    GcSpreadSheet1.Sheets(0).Cells(1, 0).Text = "A"
    GcSpreadSheet1.Sheets(0).Cells(1, 1).Text = "B"
    GcSpreadSheet1.Sheets(0).Cells(1, 2).Text = "C"
    GcSpreadSheet1.Sheets(0).Cells(2, 0).Text = "A"
    GcSpreadSheet1.Sheets(0).Cells(2, 1).Text = "B"
    GcSpreadSheet1.Sheets(0).Cells(2, 2).Text = "C"
    GcSpreadSheet1.Sheets(0).RowRangeGroup.Group(0, 2)
    'The following code removes the row range group
    'GcSpreadSheet1.Sheets(0).RowRangeGroup.Ungroup(0, 2)
    GcSpreadSheet1.Sheets(0).ColumnRangeGroup.Group(0, 1)
    'The following code removes the column range group
    'GcSpreadSheet1.Sheets(0).ColumnRangeGroup.Ungroup(0, 1)      
     Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
    GcSpreadSheet1.Sheets(0).RowRangeGroup.Expand(0, False)
    GcSpreadSheet1.Sheets(0).ColumnRangeGroup.Expand(0, False)
    End Sub
    See Also