Mini Kabibi Habibi

Current Path : C:/Users/Public/Documents/DXperience 13.1 Demos/WPF/CS/PivotGridDemo.Wpf/Modules/
Upload File :
Current File : C:/Users/Public/Documents/DXperience 13.1 Demos/WPF/CS/PivotGridDemo.Wpf/Modules/Groups.xaml.cs

using System;
using System.Windows.Data;
using System.Windows.Markup;
using DevExpress.Xpf.DemoBase;
using System.Windows;
using DevExpress.Xpf.Core;
using DevExpress.Xpf.PivotGrid;

namespace PivotGridDemo.PivotGrid {
    public partial class Groups : PivotGridDemoModule {
        bool isExpanded;

        public Groups() {
            InitializeComponent();
            pivotGrid.DataSource = NWindData.SalesPerson;
        }
        void UpdateGroupsExpanded() {
            pivotGrid.BeginUpdate();
            try {
                foreach(PivotGridGroup group in pivotGrid.Groups)
                    foreach(PivotGridField field in group)
                        field.ExpandedInFieldsGroup = isExpanded;
            } finally {
                pivotGrid.EndUpdate();
            }
        }


        private void Collapse_Click(object sender, RoutedEventArgs e) {
            isExpanded = true;
            UpdateGroupsExpanded();
        }

        private void Expand_Click(object sender, RoutedEventArgs e) {
            isExpanded = false;
            UpdateGroupsExpanded();
        }
    }
}