Articles in this section
Category / Section

How to tell whether the cell is expanded or not

1 min read

Our Pivot Grid doesn’t expose any public API to check whether expanded or collapsed for a particular cell. However we could achieve using following workaround in any pivot grid sample.

C#

private void ShowCellStatus(int rowIndex, int colIndex)

{
 
var cell = pivotGrid1.InternalGrid.Model[rowIndex, colIndex];
 
var coveredCellsInfo = this.pivotGrid1.InternalGrid.CoveredCells.GetCellSpan(rowIndex, colIndex);
 
if (cell.CellType.Equals("ExpanderCell"))
 
{
 
var summaryCell = this.pivotGrid1.InternalGrid.Model[coveredCellsInfo.Bottom + 1, colIndex];
 
var isExpanded = (summaryCell.CellIdentity as Syncfusion.Windows.Controls.PivotGrid.PivotGridStyleInfoIdentity).PivotCellInfo.Tag == null;
 
if (isExpanded)
 
{
 
MessageBox.Show("Specified cell[" + rowIndex + "," + colIndex + "] is in expanded status!");
 
}
 
else
 
{
 
MessageBox.Show("Specified cell[" + rowIndex + "," + colIndex + "] is in collapsed status");
 
}
 
}
 
}
 
 

 

.

 

C:\Users\labuser\Dropbox\Screenshots\Screenshot 2014-05-23 14.11.09.png

                                        Figure: Pivot Grid Showing status of specified cell

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied