Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143242 | Mar 11,2019 01:39 PM UTC | Mar 12,2019 07:13 AM UTC | WPF | 1 |
![]() |
Tags: PivotGridControl |
#MainWindow.xaml.cs
public MainWindow()
{
InitializeComponent();
this.pivotGrid1.Loaded += PivotGrid1_Loaded;
}
private void PivotGrid1_Loaded(object sender, RoutedEventArgs e)
{
//To hide the row grand totals alone.
int row = this.pivotGrid1.PivotEngine.RowCount - 2;
PivotCellInfo cellInfo = this.pivotGrid1.PivotEngine.PivotValues[row, 0];
if (cellInfo != null && cellInfo.CellType == (PivotCellType.RowHeaderCell | PivotCellType.GrandTotalCell))
{
this.pivotGrid1.InternalGrid.Model.RowHeights.SetHidden(row, row, true);
this.pivotGrid1.InternalGrid.InvalidateCells();
}
//To hide the column grand totals alone.
int col = this.pivotGrid1.PivotEngine.ColumnCount - this.pivotGrid1.PivotCalculations.Count - 1;
PivotCellInfo cellInfo1 = this.pivotGrid1.PivotEngine.PivotValues[0, col];
if (cellInfo1 != null && cellInfo1.CellType == (PivotCellType.HeaderCell | PivotCellType.ColumnHeaderCell | PivotCellType.GrandTotalCell))
{
for (int i = 0; i < this.pivotGrid1.PivotCalculations.Count; i++)
{
this.pivotGrid1.InternalGrid.Model.ColumnWidths.SetHidden(col + i, col + i, true);
this.pivotGrid1.InternalGrid.InvalidateCells();
}
}
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.