PivotGridControl.CollapseAllRows() Method
Collapses all rows.
Namespace: DevExpress.Xpf.PivotGrid
Assembly: DevExpress.Xpf.PivotGrid.v20.1.dll
NuGet Packages: DevExpress.WindowsDesktop.Wpf.PivotGrid, DevExpress.Wpf.PivotGrid
Declaration
Remarks
To collapse all rows asynchronously, use the PivotGridControl.CollapseAllRowsAsync method.
To expand all rows, use the PivotGridControl.ExpandAllRowsAsync (asynchronous) or PivotGridControl.ExpandAllRows (synchronous) method.
To expand or collapse all columns asynchronously, use the PivotGridControl.ExpandAllColumnsAsync and PivotGridControl.CollapseAllColumnsAsync methods, respectively (or the PivotGridControl.ExpandAllColumns and PivotGridControl.CollapseAllColumns methods to do this synchronously).
Example
This example shows how to implement custom Group Intervals.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-implement-custom-group-intervals-e2132.
Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.OleDb
Imports System.Windows
Imports DevExpress.Xpf.PivotGrid
Imports HowToBindToMDB.NwindDataSetTableAdapters
Imports System
Namespace HowToBindToMDB
''' <summary>
''' Interaction logic for MainWindow.xaml
''' </summary>
Partial Public Class MainWindow
Inherits Window
Private salesPersonDataTable As New NwindDataSet.SalesPersonDataTable()
Private salesPersonDataAdapter As New SalesPersonTableAdapter()
Public Sub New()
InitializeComponent()
pivotGridControl1.DataSource = salesPersonDataTable
End Sub
Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
salesPersonDataAdapter.Fill(salesPersonDataTable)
pivotGridControl1.CollapseAllRows()
End Sub
Private Sub pivotGridControl1_CustomGroupInterval(ByVal sender As Object, _
ByVal e As PivotCustomGroupIntervalEventArgs)
If (Not Object.ReferenceEquals(e.Field, fieldProductGroup)) Then
Return
End If
Dim productName As String = Convert.ToString(e.Value)
If productName.Chars(0) < "F"c Then
e.GroupValue = "A-E"
ElseIf productName.Chars(0) > "E"c AndAlso productName.Chars(0) < "T"c Then
e.GroupValue = "F-S"
ElseIf productName.Chars(0) > "S"c Then
e.GroupValue = "T-Z"
End If
End Sub
End Class
End Namespace