Completed
Last Updated: 07 Mar 2016 11:54 by ADMIN
To reproduce: 
1. Add RadPivotGrid on the form and populate it with data 
2. Add 2 buttons to export to xls and xlsx formats 
3. Run the form and export to xls format 
4. Minimize the form. You will see that one of row is disappeared
5. Repeat the same action and you will see that a second row is disappeared. 

The issue if observed with both exporter providers (PivotGridSpreadExport/PivotExportToExcelML) and export with visual settings. 

Workaround: 
In the handler of the SizeChanged event clear the cached elements: 
void Form1_SizeChanged(object sender, EventArgs e)
{
    this.radPivotGrid1.PivotGridElement.PivotRowsContainer.ElementProvider.ClearCache(); 
}
Completed
Last Updated: 18 May 2016 06:01 by ADMIN
Steps to reproduce:
Just add a value filter using the ValueFilterDialog. The filter is being applied properly, however, if you read the PropertyGroupDescription to which the filter has been added and check its AggregateIndex property, it is always 0.

Workaround: Use a custom ValueFilterDialog: http://docs.telerik.com/devtools/winforms/pivotgrid/dialogs/customizing-the-dialogs

this.radPivotGrid1.DialogsFactory = new MyDialogsFactory();
this.radPivotFieldList1.DialogsFactory = new MyDialogsFactory();

public class MyDialogsFactory : PivotGridDialogsFactory
{
    public override IValueFilterOptionsDialog CreateValueFilterOptionsDialog()
    {
        return new MyValueFilterOptionsDialog();
    }
}

public partial class MyValueFilterOptionsDialog : ValueFilterOptionsDialog
{
    public override Telerik.Pivot.Core.Filtering.IValueGroupFilter SelectedFilter
    {
        get
        {
            IValueGroupFilter filter =  base.SelectedFilter;
            filter.AggregateIndex = ((RadDropDownList)this.Controls["groupBox"].Controls["dropDownField"]).SelectedIndex;

            return filter;
        }

public override void LoadSettings(IValueGroupFilter filter, IValueGroupFilterHost filterHost, string fieldName, IEnumerable<string> aggregateNames)
{
    base.LoadSettings(filter, filterHost, fieldName, aggregateNames);
    if (filter != null)
    {
        ((RadDropDownList)this.Controls["groupBox"].Controls["dropDownField"]).SelectedIndex = filter.AggregateIndex;
    }
}

    }
}

Completed
Last Updated: 09 May 2016 13:59 by ADMIN
To reproduce:

this.ordersTableAdapter.Fill(this.nwindDataSet.Orders);
this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() 
{ PropertyName = "OrderDate", Step = DateTimeStep.Year, GroupComparer = new GroupNameComparer() });
this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() 
{ PropertyName = "OrderDate", Step = DateTimeStep.Quarter, GroupComparer = new GroupNameComparer() });
this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() 
{ PropertyName = "OrderDate", Step = DateTimeStep.Month, GroupComparer = new GroupNameComparer() });
this.radPivotGrid1.ColumnGroupDescriptions.Add(new PropertyGroupDescription() 
{ PropertyName = "EmployeeID", GroupComparer = new GrandTotalComparer() });
this.radPivotGrid1.FilterDescriptions.Add(new PropertyFilterDescription() 
{ PropertyName = "ShipCountry", CustomName = "Country" });
this.radPivotGrid1.DataSource = this.ordersBindingSource;


Workaround:

public Form1()
{
    InitializeComponent();

    this.radPivotGrid1.DialogsFactory = new MyDialogsFactory();
    this.radPivotFieldList1.DialogsFactory = new MyDialogsFactory();
}

public class MyDialogsFactory : PivotGridDialogsFactory
{
    public override ITop10FilterOptionsDialog CreateTop10FilterOptionsDialog()
    {
        return new MyITop10FilterOptionsDialog();
    } 
}

public class MyITop10FilterOptionsDialog : Top10FilterOptionsDialog 
{
    public override ITopGroupsFilter SelectedFilter
    {
        get
        {
            if (((RadDropDownList)this.Controls["groupBox"].Controls["dropDownFields"]).SelectedValue == null)
            {
                return null;
            }
            return base.SelectedFilter;
        }
    }
}
Completed
Last Updated: 03 Jun 2016 06:01 by ADMIN
Workaround: use custom context menu

 public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            MyPivotGridContextMenu menu = new MyPivotGridContextMenu(this.radPivotGrid1.PivotGridElement);
            this.radPivotGrid1.PivotGridElement.ContextMenu = menu;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.productsTableAdapter.Fill(this.nwindDataSet.Products);

            LocalDataSourceProvider dataProvider = new LocalDataSourceProvider();

            dataProvider.ItemsSource = nwindDataSet.Products;

            dataProvider.BeginInit();
            dataProvider.RowGroupDescriptions.Add(new PropertyGroupDescription() { PropertyName = "CategoryID", GroupComparer = new GroupNameComparer() });
            dataProvider.RowGroupDescriptions.Add(new PropertyGroupDescription() { PropertyName = "ProductName", GroupComparer = new GroupNameComparer() });
            dataProvider.ColumnGroupDescriptions.Add(new PropertyGroupDescription() { PropertyName = "ProductID" });
            dataProvider.AggregateDescriptions.Add(new PropertyAggregateDescription() { PropertyName = "UnitPrice", AggregateFunction = AggregateFunctions.Sum });
            dataProvider.EndInit();

            this.radPivotGrid1.DataProvider = dataProvider;
        }
    }

public class MyPivotGridContextMenu : PivotGridContextMenu
{
    public MyPivotGridContextMenu(RadPivotGridElement pivotGridElement)
        : base(pivotGridElement)
    { }


    protected override void OnCollapseAllMenuItemClick(object sender, EventArgs e)
    {
        PivotGroupElement groupElement = this.Context as PivotGroupElement;

        if (groupElement != null)
        {
             RadPivotGridElement pivotGridElement = this.GetType().BaseType
                .GetField("pivotGridElement", BindingFlags.Instance | BindingFlags.NonPublic)
                .GetValue(this) as RadPivotGridElement;

            pivotGridElement.SuspendLayout(true);

            if (groupElement.Data.Axis == PivotAxis.Rows)
            {
                foreach (PivotGroupNode node in pivotGridElement.GetRowGroups())
                {
                    node.Expanded = false;
                }
            }
            else
            {
                foreach (PivotGroupNode node in pivotGridElement.GetColumnGroups())
                {
                    node.Expanded = false;
                }
            }

            pivotGridElement.ResumeLayout(true, true);
            pivotGridElement.UpdateAfterExpandCollapse();
        }
    }
}
Completed
Last Updated: 21 Jun 2016 07:49 by ADMIN
Workaround: create a custom Top10FilterOptionsDialog

public Form1()
{
    InitializeComponent();

    this.radPivotFieldList1.DialogsFactory = new MyDialogsFactory();
}

public class MyDialogsFactory : PivotGridDialogsFactory
{
    public override ITop10FilterOptionsDialog CreateTop10FilterOptionsDialog()
    {
        return new MyTop10FilterOptionsDialog();
    }
}

public class MyTop10FilterOptionsDialog : Top10FilterOptionsDialog
{
    public override void LoadSettings(Telerik.Pivot.Core.Filtering.ITopGroupsFilter filter, string fieldName, IEnumerable<string> aggregateNames)
    {
        base.LoadSettings(filter, fieldName, aggregateNames);

        if (filter != null)
        {
            ((RadDropDownList)this.Controls["groupBox"].Controls["dropDownTopBottom"]).SelectedValue = filter.Selection;
        }
    }
}
Completed
Last Updated: 14 Jun 2016 05:51 by ADMIN
How to reproduce:

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_MouseDoubleClick(object sender, MouseEventArgs e)
    {
        PivotGridSpreadExport spreadExport = new PivotGridSpreadExport(this.radPivotGrid1);

        spreadExport.RunExport(@"..\..\exported-file.xlsx", new SpreadExportRenderer());
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        this.productsTableAdapter.Fill(this.nwindDataSet.Products);

        LocalDataSourceProvider dataProvider = new LocalDataSourceProvider();

        dataProvider.ItemsSource = nwindDataSet.Products;

        dataProvider.BeginInit();
        dataProvider.RowGroupDescriptions.Add(new PropertyGroupDescription() { PropertyName = "CategoryID", GroupComparer = new GroupNameComparer() });
        dataProvider.AggregateDescriptions.Add(new PropertyAggregateDescription() { PropertyName = "UnitPrice", AggregateFunction = AggregateFunctions.Sum });
        dataProvider.EndInit();

        this.radPivotGrid1.DataProvider = dataProvider;
    }
}


Workaround: create a custom pivot grid export object

 public partial class Form1 : Form
 {
     public Form1()
     {
         InitializeComponent();
     }

     private void Form1_MouseDoubleClick(object sender, MouseEventArgs e)
     {
         MyPivotGridSpreadExport spreadExport = new MyPivotGridSpreadExport(this.radPivotGrid1);

         spreadExport.RunExport(@"..\..\exported-file.xlsx", new SpreadExportRenderer());
     }

     private void Form1_Load(object sender, EventArgs e)
     {
         this.productsTableAdapter.Fill(this.nwindDataSet.Products);

         LocalDataSourceProvider dataProvider = new LocalDataSourceProvider();

         dataProvider.ItemsSource = nwindDataSet.Products;

         dataProvider.BeginInit();
         dataProvider.RowGroupDescriptions.Add(new PropertyGroupDescription() { PropertyName = "CategoryID", GroupComparer = new GroupNameComparer() });
         dataProvider.AggregateDescriptions.Add(new PropertyAggregateDescription() { PropertyName = "UnitPrice", AggregateFunction = AggregateFunctions.Sum });
         dataProvider.EndInit();

         this.radPivotGrid1.DataProvider = dataProvider;
     }
 }

public class MyPivotGridSpreadExport : PivotGridSpreadExport
{
    public MyPivotGridSpreadExport(RadPivotGrid pivotGrid)
        : base(pivotGrid) { }

    public override void Initialize()
    {
        base.Initialize();

        RadPivotGridElement pivotGrid = this.GetType().BaseType.GetField("pivotGrid", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as RadPivotGridElement;
        List<int> rowHeights = this.GetType().BaseType.GetField("rowHeights", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as List<int>;
        List<DescriptionBase> columnDescriptions = this.GetType().BaseType.GetField("columnDescriptions", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as List<DescriptionBase>;

        if (columnDescriptions.Count == 0)
        {
            rowHeights.Add(pivotGrid.RowHeight);
            columnDescriptions.Add(null);
        }
    }
}
Completed
Last Updated: 20 Jul 2016 09:13 by ADMIN
Workaround: 
public class MyRadPivotGrid : RadPivotGrid
{
    public override void SaveLayout(string fileName)
    {
        ComponentXmlSerializer ser = new ComponentXmlSerializer(this.XmlSerializationInfo);

        using (XmlTextWriter writer = new XmlTextWriter(fileName, Encoding.UTF8))
        {
            writer.Formatting = Formatting.Indented;
            writer.WriteStartElement("RadPivotGrid");
            ser.WriteObjectElement(writer, this);
        }
    }
}
Completed
Last Updated: 11 Jul 2017 14:00 by ADMIN
To reproduce:
Try setting the value in the CellForamting event. 

Workaround:
class MySpreadExportRenderer : SpreadExportRenderer
{
    public override void SetCellSelectionValue(DataType dataType, object value)
    {
        base.SetCellSelectionValue(dataType, value);
        if (dataType == DataType.Number)
        {
            CellRange range = ((CellSelection)this.GetCellSelection()).CellRanges.ElementAtOrDefault(0);
            double d;
            if (double.TryParse(Convert.ToString(value), out d))
            {
                var cell = ((Worksheet)this.GetWorksheet()).Cells[range.FromIndex.RowIndex, range.FromIndex.ColumnIndex];
                cell.SetFormat(new CellValueFormat("#,##0.00"));
                cell.SetValue(d);
            }
        }
    }
}

Completed
Last Updated: 12 Mar 2018 12:17 by Dimitar
How to reproduce: check the attached project and screenshots, the correct items are shown in screenshot correct-items-calculated-field.jpg

Workaround: 
public partial class Form1 : Form
{
    private LocalDataSourceProvider provider;

    public Form1()
    {
        InitializeComponent();

        //Setup pivot and add calculated field

        //Workaround
        this.radPivotFieldList1.ValuesControl.CreatingVisualListItem += ValuesControl_CreatingVisualListItem;
    }

    private void ValuesControl_CreatingVisualListItem(object sender, CreatingVisualListItemEventArgs args)
    {
        args.VisualItem = new MyPivotFieldListVisualItem(this.radPivotFieldList1.ViewModel);
    }
}

public class MyPivotFieldListVisualItem : PivotFieldListVisualItem
{
    FieldListViewModel viewModel;

    public MyPivotFieldListVisualItem(FieldListViewModel viewModel)
        : base(viewModel)
    {
        this.viewModel = viewModel;
    }

    protected override void UpdateContextMenu()
    {
        base.UpdateContextMenu();

        PivotFieldListItemButton button = (PivotFieldListItemButton)typeof(PivotFieldListVisualItem).GetField("button", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(this);
        string providerName = this.viewModel.DataProvider != null ? this.viewModel.DataProvider.GetType().FullName : String.Empty;
        if (this.Data == null)
        {
            return;
        }

        if (this.Data.DataBoundItem is Value && !(providerName.Contains("Xmla") || providerName.Contains("Adomd")))
        {
            for (int i = 0; i < 5; i++)
            {
                button.Items.RemoveAt(i);
            }
        }
    }
}


Completed
Last Updated: 11 Oct 2018 14:04 by Dimitar
How to reproduce: 
Me.RadPivotGrid1.DataSource = Nothing

Workaround: 
DirectCast(Me.RadPivotGrid1.DataProvider, LocalDataSourceProvider).ItemsSource = Nothing
Dim viewModel = Me.RadPivotGrid1.PivotGridElement.GetType().GetField("viewModel", BindingFlags.Instance Or BindingFlags.NonPublic).GetValue(Me.RadPivotGrid1.PivotGridElement)
viewModel.GetType().GetProperty("DataProvider").SetValue(viewModel, Nothing)
Completed
Last Updated: 29 Mar 2019 09:40 by Dimitar
How to reproduce: see the attached video

Workaround:
public partial class Form2 : Form
{
    public Form2()
    {
        InitializeComponent();

        this.radPivotFieldList1.DragDropService = new CustomPivotFieldListDragDropService(this.radPivotFieldList1);
    }

    private void Form2_Load(object sender, EventArgs e)
    {
        // TODO: This line of code loads data into the 'nwindDataSet.Orders' table. You can move, or remove it, as needed.
        this.ordersTableAdapter.Fill(this.nwindDataSet.Orders);

    }
}

public class CustomPivotFieldListDragDropService : PivotFieldListDragDropService
{
    private RadPivotFieldList fieldList;
    private Telerik.WinControls.UI.PivotFieldList.FieldPayload payload;

    public CustomPivotFieldListDragDropService(RadPivotFieldList fieldList)
        : base(fieldList)
    {
        this.fieldList = fieldList;
    }

    protected override void PerformStart()
    {
        base.PerformStart();

        Telerik.WinControls.UI.PivotFieldList.IField draggedField = this.GetField(this.Context);

        if (draggedField == null)
        {
            this.Stop(false);
            return;
        }

        this.payload = new Telerik.WinControls.UI.PivotFieldList.FieldPayload(draggedField);
    }

    protected override void OnPreviewDragOver(RadDragOverEventArgs e)
    {
        RadElement targetElement = this.DropTarget as RadElement;
        Telerik.WinControls.UI.PivotFieldList.IField targetField = this.GetField(targetElement);

        if (targetElement != null && targetElement.ElementTree.Control == this.fieldList.ReportFiltersControl && this.payload != null)
        {
            foreach (Telerik.WinControls.UI.PivotFieldList.IField field in this.fieldList.ViewModel.Filters)
            {
                if (field.FieldInfo == payload.DraggedField.FieldInfo &&  this.Context is TreeNodeElement ))
                {
                    e.CanDrop = false;
                    this.payload.SetDestination(null);
                    this.payload.RemoveFromSource = false;

                    return;
                }
            }
        }

        base.OnPreviewDragOver(e);
    }

    private Telerik.WinControls.UI.PivotFieldList.IField GetField(object context)
    {
        RadListVisualItem listItem = context as RadListVisualItem;
        TreeNodeElement treeItem = context as TreeNodeElement;
        PivotFieldListItemButton button = context as PivotFieldListItemButton;

        if (button != null)
        {
            listItem = button.Owner;
        }

        Telerik.WinControls.UI.PivotFieldList.IField field1 = null, field2 = null;
        if (listItem != null && listItem.Data != null)
        {
            field1 = listItem.Data.DataBoundItem as Telerik.WinControls.UI.PivotFieldList.IField;
        }

        if (treeItem != null && treeItem.Data != null)
        {
            field2 = treeItem.Data.DataBoundItem as Telerik.WinControls.UI.PivotFieldList.IField;
        }

        return field1 ?? field2;
    }
}
Completed
Last Updated: 12 Oct 2020 16:30 by ADMIN
Release R3 2020 SP1

The error is reproducible in the First look example of RadPivotGrid:

Completed
Last Updated: 01 Nov 2021 15:09 by ADMIN
Release R3 2021 SP1

Here is my code for localizing the Sum aggregate function. The obtained result is a partial translation:

 

        public RadForm1()
        {
            PivotGridLocalizationProvider.CurrentProvider = new MyEnglishPivotGridLoclizationProvider();
            InitializeComponent();
        }

        private void RadForm1_Load(object sender, EventArgs e)
        {
            this.ordersTableAdapter.Fill(this.nwindDataSet.Orders);

            this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() { PropertyName = "OrderDate", Step = DateTimeStep.Year, GroupComparer = new GroupNameComparer() });
            this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() { PropertyName = "OrderDate", Step = DateTimeStep.Quarter, GroupComparer = new GroupNameComparer() });
            this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() { PropertyName = "OrderDate", Step = DateTimeStep.Month, GroupComparer = new GroupNameComparer() });
            this.radPivotGrid1.ColumnGroupDescriptions.Add(new PropertyGroupDescription() { PropertyName = "EmployeeID", GroupComparer = new GrandTotalComparer() });
            this.radPivotGrid1.AggregateDescriptions.Add(new PropertyAggregateDescription() { PropertyName = "Freight", AggregateFunction = AggregateFunctions.Sum });
            this.radPivotGrid1.AggregateDescriptions.Add(new PropertyAggregateDescription() { PropertyName = "Freight", AggregateFunction = AggregateFunctions.Count });
            this.radPivotGrid1.FilterDescriptions.Add(new PropertyFilterDescription() { PropertyName = "ShipCountry", CustomName = "Country" });
            this.radPivotGrid1.DataSource = this.ordersBindingSource;
        }

        class MyEnglishPivotGridLoclizationProvider : PivotGridLocalizationProvider
        {
            public override string GetLocalizedString(string id)
            {
                switch (id)
                {
                    case PivotStringId.Sum:
                        return "Soma"; 
                    default:
                        return base.GetLocalizedString(id);
                }
            }
        }

Completed
Last Updated: 13 Apr 2022 06:31 by ADMIN
Release R2 2022

My pivot grid data size is 90,388 rows, and I export data to xlsx format with SheetName = "data".

The output file generated in this case (correctly) has 65536 rows on sheet "data" and the remaining 24852 rows on the sheet "data_2" (since SheetMaxRows = 65536 and total rows > SheetMaxRows, second sheet "data_2" is added automatically).

But the rows on the sheet "data_2" are written starting from line number 65538. The data on sheet "data_2" starts on line 65538 and goes till line 90389.

Expected:

Actual:

 

Workaround; use the following custom renderer:

        public class MyRenderer : SpreadExportRenderer
        {
            public override void CreateCellSelection(int rowIndex, int columnIndex)
            {
                if (rowIndex > (int)Telerik.WinControls.UI.Export.ExcelMaxRows._65536)
                {
                    rowIndex = rowIndex % (int)Telerik.WinControls.UI.Export.ExcelMaxRows._65536 - 1;
                }
                else
                {
                    rowIndex = rowIndex % (int)Telerik.WinControls.UI.Export.ExcelMaxRows._65536;
                }
                base.CreateCellSelection(rowIndex, columnIndex);
            }
        }

Completed
Last Updated: 27 May 2022 13:53 by ADMIN
Release R2 2022 SP1
In this case, when the RadPivotGrid is connected to a chart and we call the UpdateUI() method at an early stage, a NullReferenceException exception will appear.
Completed
Last Updated: 27 Mar 2023 06:35 by ADMIN
Release R1 2023 SP1

When using Crystal or CrystalDark themes, the resize cursor is not showing to widen/shrink the columns:

Expected:

Actual:

1 2 3 4