Completed
Last Updated: 07 Oct 2016 07:18 by ADMIN
ADMIN
Hristo
Created on: 06 Oct 2016 12:59
Category: PivotGrid
Type: Bug Report
1
FIX. RadPivotGrid - row headers width should be respected when the pivot is being printed
Workaround:
private void PrintPivotGrid()
{
    MyPivotGridPrintStyle style = new MyPivotGridPrintStyle();
    style.LayoutType = PivotLayout.Tabular;
    this.radPivotGrid1.PrintStyle = style;
    this.radPivotGrid1.PrintPreview();
}

public class MyPivotGridPrintStyle : PivotGridPrintStyle
{
    public override void Initialize()
    {
        base.Initialize();

        FieldInfo fiColumnWidths = this.GetType().BaseType.GetField("columnWidths", BindingFlags.Instance | BindingFlags.NonPublic);
        List<int> columnWidths = (List<int>)fiColumnWidths.GetValue(this);
        RadPivotGridElement pivotGrid = (RadPivotGridElement)this.GetType().BaseType.GetField("pivotGrid", BindingFlags.Instance | BindingFlags.NonPublic)
                                                                                    .GetValue(this);

        for (int i = 0; i < pivotGrid.RowDescriptorsArea.Children.Count; i++)
        {
            RadElement descriptor = pivotGrid.RowDescriptorsArea.Children[i];
            columnWidths[i] = descriptor.Size.Width;
        }
    }
}


0 comments