|
Query |
Response |
|
When debugging i see that PivotCalculations list is updated in this.Target with the correct count value and the schemaDesigner.PivotCalculationList has a count value of 0. |
We are unable to reproduce at our end. By default, if Target (pivotgrid) is updated, the schemaDesigner PivotCalculationList value also updated. |
|
schemaDesigner.InitializePivotTableList() is not doing anything. |
This method will initialize only pivottablelist based on the given item source (such as Shape, color, etc.,). This method doesn’t add any items into the target. |
|
var schemaDesigner = (PivotSchemaDesigner)(this.Target as PivotGridControl).GetType().GetProperty("SchemaDesigner", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this.Target, null);
if (schemaDesigner != null)
{
schemaDesigner.PivotCalculationList.ItemsSource = schemaDesigner.PivotControl.PivotCalculations;
} |
There is no need to set the itemsource values into the PivotCalcualtionList. As we said earlier, if the PivotCalculations values are added in the target property, calculation values are added into the PivotCalcualtionList automatically. |
|
protected override void Invoke(object parameter)
{
if (parameter is RoutedEventArgs)
{
RoutedEventArgs eventArgs = parameter as RoutedEventArgs;
var sourceCmBox = eventArgs.OriginalSource as ComboBox;
if (sourceCmBox != null)
{
if (sourceCmBox.SelectedItem.ToString() == "Action1")
//Clear the Target itemsource.
(Target.ItemSource as ProductSalesCollection).Clear();
else if (sourceCmBox.SelectedItem.ToString() == "Action2")
{
//Update the Target itemsource.
Target.ItemSource = ProductSales.GetSalesData();
var schemaDesigner = (PivotSchemaDesigner)(this.Target as PivotGridControl).GetType().GetProperty("SchemaDesigner", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this.Target, null);
if (schemaDesigner != null)
{
schemaDesigner.InitializePivotTableList();
if (schemaDesigner.PivotCalculationList != null && schemaDesigner.PivotCalculationList.Items.Count > 0)
{
}
}
}
}
}
} |