<PivotViewRows>
<PivotViewRow Name="A" ShowNoDataItems="false"></PivotViewRow>
<PivotViewRow Name="B" ShowNoDataItems="false"></PivotViewRow>
</PivotViewRows>
Is there a way to disable the drill down based on a value that is found within the dataset for the row OR
Either hide or remove the PivotViewRow "B" completely if a value is found within the dataset for that row.
I only want to show the drill down child row on certain rows.
It is my understanding you get a drill down arrow when you have more than one pivoviewrow like:
<PivotViewRows>
<PivotViewRow Name="A" ShowNoDataItems="false"></PivotViewRow>
<PivotViewRow Name="B" ShowNoDataItems="false"></PivotViewRow>
</PivotViewRows>
You click A to drilldown/view B in the fist row of the pivot. I want to hide or disable row B if A = X so that there is no drill down for that row of data.
|
private void EnginePopulated(EnginePopulatedEventArgs args)
{
for (var i = 0; i < args.PivotValues.Count(); i++)
{
for (var j = 0; (args.PivotValues[i] != null && j < args.PivotValues[i].Count()); j++)
{
if (args.PivotValues[i][0] != null && args.PivotValues[i][j] != null && args.PivotValues[i][0].Axis == "row")
{
var rowHeaders = (args.PivotValues[i][0].ValueSort["levelName"] as string).Split(new[] { pivot.DataSourceSettings.ValueSortSettings.HeaderDelimiter }, StringSplitOptions.None);
if (args.PivotValues[i][0].FormattedText != "France" && rowHeaders.Contains("France"))
{
args.PivotValues[i][j].FormattedText = "";
}
}
}
}
} |
Thanks for pointing me in the right direction however this still had the rows present....empty but present. I was able to accomplish what I needed by setting the haschild to false.
private void EnginePopulated(EnginePopulatedEventArgs args)
{ if (pivotAgingRates != null)
{
for (var i = 0; i < args.PivotValues.Count(); i++)
{
for (var j = 0; (args.PivotValues[i] != null && j < args.PivotValues[i].Count()); j++)
{
if (args.PivotValues[i][0] != null && args.PivotValues[i][j] != null && args.PivotValues[i][0].Axis == "row")
{
var rowHeaders = (args.PivotValues[i][0].ValueSort["levelName"] as string).Split(new[] { pivotAgingRates.DataSourceSettings.ValueSortSettings.HeaderDelimiter }, StringSplitOptions.None);
if (!rowHeaders.Contains("XXXXX"))
{
args.PivotValues[i][0].HasChild = false;
}
}
}
}
}
}