Spread Silverlight Documentation
Expand(Int32,Boolean) Method
Example 


The level of the outline to expand or collapse.
Whether to expand the groups.
Expands all outlines (range groups), by the specified level.
Syntax
'Declaration
 
Public Overloads Sub Expand( _
   ByVal level As System.Integer, _
   ByVal expand As System.Boolean _
) 
'Usage
 
Dim instance As RangeGroup
Dim level As System.Integer
Dim expand As System.Boolean
 
instance.Expand(level, expand)
public void Expand( 
   System.int level,
   System.bool expand
)

Parameters

level
The level of the outline to expand or collapse.
expand
Whether to expand the groups.
Example
This example uses the Expand 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);      
gcSpreadSheet1.Invalidate();

private void button1_Click(object sender, RoutedEventArgs e)
        {
gcSpreadSheet1.Sheets[0].RowRangeGroup.Expand(0, false);
gcSpreadSheet1.Sheets[0].ColumnRangeGroup.Expand(0, false);
gcSpreadSheet1.Invalidate();
      }
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)      
GcSpreadSheet1.Invalidate()

 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)
GcSpreadSheet1.Invalidate()
End Sub
Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

RangeGroup Class
RangeGroup Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.