Hi,
I use the following code (found in this forum)in order to expand dimensions from code :
void pivotGridMap_LayoutLoaded(object sender, EventArgs e)
{
foreach (PivotHeaderCell cell in pivotGridMap.GridLayout.RowHeaderCells)
if (cell.IsToggleVisible && cell.IsExpanded == false)
cell.IsExpanded = true;
return;
}
I'm using the same sample and using the most current version of the SDK (11.2) and I still get the same error. "An item with the same key has already been added." I'm trying to open the top level. This was working when I had both foreach loops in the event and had returns after the assignment to true, but I don't see why that would work. Does this mean I have to keep track of when I toggle the cell open rather than just check the flag that should be set?
private void ExpandTopLevelCell(IEnumerable<PivotHeaderCell> cells)
foreach (PivotHeaderCell cell in cells)
// The top level cell has NO PARENT.
if (cell.ParentCell == null && cell.IsToggleVisible && cell.IsExpanded == false)
private void uxMainPivotGrid_LayoutLoaded(object sender, EventArgs e)
ExpandTopLevelCell(uxMainPivotGrid.GridLayout.ColumnHeaderCells);
ExpandTopLevelCell(uxMainPivotGrid.GridLayout.RowHeaderCells);
HI Dimitris,
I was not able to reproduce this issue.
I am using the 11.1 release build.
I am attaching my sample,
Sincerely, Matt DSE