DataGrid.Collapse Method (Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Collapses child relations, if any exist for all rows, or for a specified row.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public void Collapse(
	int row


Type: System.Int32

The number of the row to collapse. If set to -1, all rows are collapsed.

Use the IsExpanded method to determine if a row is expanded.

The following code example collapses all rows in the System.Windows.Forms.DataGrid control.

DataGrid1.Collapse( -1 )

.NET Framework
Available since 1.1
Return to top