This is a migrated thread and some comments may be shown as answers.

Can I get rid of these pivot artifacts

2 Answers 9 Views
PivotGrid and PivotFieldList
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Veteran
Michael asked on 02 Feb 2021, 09:49 AM
I'm putting up the field-list window to allow the user to choose the rows, columns and aggregations.  I'd like to hide the controls shown in the pictures I'm uploading.

2 Answers, 1 is accepted

Sort by
0
Accepted
Nadya
Telerik team
answered on 03 Feb 2021, 01:20 PM

Hello, Michael,

In order to hide the AggregateDescriptorsAreaRowDescriptorsArea, and ColumnDescriptorsArea you can set their Visibility to Hidden. If you want to remove the ShowFiledLiest menu item from the context menu you should create a custom PivotGridContextMenu and override the AdjustItemsForContext method.

Please refer to the following code snippet:

public RadForm1()
{
    InitializeComponent();

    this.radPivotGrid1.PivotGridElement.AggregateDescriptorsArea.Visibility = ElementVisibility.Hidden;
    this.radPivotGrid1.PivotGridElement.RowDescriptorsArea.Visibility = ElementVisibility.Hidden;
    this.radPivotGrid1.PivotGridElement.ColumnDescriptorsArea.Visibility = ElementVisibility.Hidden;

    MyPivotGridContextMenu menu = new MyPivotGridContextMenu(this.radPivotGrid1.PivotGridElement);
    this.radPivotGrid1.PivotGridElement.ContextMenu = menu; 
}
public class MyPivotGridContextMenu : PivotGridContextMenu
{
    public MyPivotGridContextMenu(RadPivotGridElement pivotGridElement)
        : base(pivotGridElement) { }

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

        this.Items.RemoveAt(1);
    }
}

I hope this helps. Should you have other questions do not hesitate to contact me.

Regards,
Nadya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Michael
Top achievements
Rank 1
Veteran
answered on 08 Feb 2021, 12:08 PM
Thank you very much, that worked.
Tags
PivotGrid and PivotFieldList
Asked by
Michael
Top achievements
Rank 1
Veteran
Answers by
Nadya
Telerik team
Michael
Top achievements
Rank 1
Veteran
Share this question
or