Articles in this section
Category / Section

How to achieve dynamic column or row creation in our Pivot Grid

1 min read

We are mainly concentrating PivotGrid for IEnumerable/DataTable which is best & specifically created for In-memory analytics. Hence, for In-Memory analytics, we strongly suggest you to check PivotGrid control.

XAML

<StackPanel Orientation="Vertical">
                <Button Content="Add Column" Click="Button_Click" />
            </StackPanel>

 

C#

private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.pivotGrid1.PivotColumns.Add(new PivotItem { FieldHeader = "State", FieldMappingName = "State", TotalHeader = "Total" });
            this.pivotGrid1.Refresh();
        }

 

C:\Users\labuser\Dropbox\Screenshots\Screenshot 2014-06-09 15.13.27.png

Figure: Normal Pivot Grid

C:\Users\labuser\Dropbox\Screenshots\Screenshot 2014-06-09 15.12.31.png

Figure: Pivot Grid shows dynamically added column

 

 

 

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