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

Make the labels in the Aggregates area more uniformly legible

3 Answers 112 Views
PivotGrid and PivotFieldList
This is a migrated thread and some comments may be shown as answers.
Karen
Top achievements
Rank 1
Karen asked on 27 Mar 2020, 03:45 PM

Is there anyway to make label in the Aggregates area more uniformly legible?

My PivotGrid has a lot of column to display.
 I make some changes: 
 
PivotAggregateDescriptorContainer pivotAggregateDescriptorsAreaContainer = radPivotGrid.PivotGridElement.AggregateDescriptorsArea;
pivotAggregateDescriptorsAreaContainer.FixedItemSize = true;

And implement method:
void radPivotGrid_AggregateDescriptorElementCreating(object sender, AggregateDescriptorElementCreatingEventArgs e)
{
    PivotAggregateDescriptorElement aggregateElement = e.AggregateDescriptorElement;
    aggregateElement.TextWrap = true;
    aggregateElement.DrawFill = false;
}

The issue is that PivotAggregateDescriptorContainer  overlap PivotColumnDescriptorContainer, It doesn't see "Aggregates" label.

Please help

Thank you.

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Apr 2020, 08:31 AM

Hello, Karen,

Note that the PivotGridElement.ColumnWidth property is appropriate for adjusting the aggregate area's width in order to fit the content in it.

Before:

After:

  this.radPivotGrid1.PivotGridElement.ColumnWidth = 150;


I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Nhi
Top achievements
Rank 1
answered on 01 Apr 2020, 05:00 PM

I have many columns in report.  User cannot tell what aggregates are on report unless the hover.

I don't want to set column width.  If I widen so much horizontally that the format of report is bad. 

Is there any way I set vertically?  Or do something ? Please look the attached file.  

 

Thank you
 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 06 Apr 2020, 09:24 AM

Hello, Nhi,  

It seems that the mentioned file is missing. However, you can manage the PivotGridElement.ColumnHeaderHeight property and wrap the text in the aggregates as follows:

        public RadForm1()
        {
            InitializeComponent();
            this.radPivotGrid1.PivotGridElement.AggregateDescriptorElementCreating += PivotGridElement_AggregateDescriptorElementCreating;
        }

        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.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.Average });
            this.radPivotGrid1.AggregateDescriptions.Add(new PropertyAggregateDescription() { PropertyName = "OrderDate", AggregateFunction = AggregateFunctions.Min });
            this.radPivotGrid1.AggregateDescriptions.Add(new PropertyAggregateDescription() { PropertyName = "Freight", AggregateFunction = AggregateFunctions.Max });
            this.radPivotGrid1.FilterDescriptions.Add(new PropertyFilterDescription() { PropertyName = "ShipCountry", CustomName = "Country" });
           
            this.radPivotGrid1.DataSource = this.ordersBindingSource;

            this.radPivotGrid1.PivotGridElement.ShowFilterArea = true;
            this.radPivotGrid1.PivotGridElement.FilterAreaHeight = 45; 

            PivotAggregateDescriptorContainer pivotAggregateDescriptorsAreaContainer = this.radPivotGrid1.PivotGridElement.AggregateDescriptorsArea;
            pivotAggregateDescriptorsAreaContainer.FixedItemSize = false; 
            this.radPivotGrid1.PivotGridElement.ColumnHeaderHeight = 60;
        }

        void PivotGridElement_AggregateDescriptorElementCreating(object sender, AggregateDescriptorElementCreatingEventArgs e)
        {
            PivotAggregateDescriptorElement aggregateElement = e.AggregateDescriptorElement;
            aggregateElement.TextWrap = true;
            aggregateElement.DrawFill = false;
            aggregateElement.AutoSize = false;
            aggregateElement.Size = new Size(50, 50);
        }

I believe that it would be suitable for your case.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
PivotGrid and PivotFieldList
Asked by
Karen
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Nhi
Top achievements
Rank 1
Share this question
or