Esempio n. 1
0
File: XGrid.cs Progetto: JWPLAY/AUBE
        public XGrid()
        {
            InitializeComponent();
            Initialize();
            InitializeEvents();

            _PrintableComponentLink.CreateReportHeaderArea += delegate(object sender, CreateAreaEventArgs e)
            {
                if (PrintHeader.IsNullOrEmpty() == false)
                {
                    e.Graph.StringFormat = new BrickStringFormat(StringAlignment.Center);
                    e.Graph.Font         = new Font(SystemFonts.DefaultFont.FontFamily, 14f, FontStyle.Bold);
                    var rect = new RectangleF(0, 0, e.Graph.ClientPageSize.Width, 50);
                    e.Graph.DrawString(PrintHeader, Color.Black, rect, BorderSide.None);
                }
            };
            _PrintableComponentLink.CreateReportFooterArea += delegate(object sender, CreateAreaEventArgs e)
            {
                if (PrintFooter.IsNullOrEmpty() == false)
                {
                    e.Graph.StringFormat = new BrickStringFormat(StringAlignment.Near);
                    e.Graph.Font         = new Font(SystemFonts.DefaultFont.FontFamily, 10f, FontStyle.Regular);
                    var rect = new RectangleF(0, e.Graph.ClientPageSize.Height - 50, e.Graph.ClientPageSize.Width, 50);
                    e.Graph.DrawString(PrintHeader, Color.Black, rect, BorderSide.None);
                }
            };

            _GridView.PopupMenuShowing          += GridViewPopupMenuShowing;
            _BandedGridView.PopupMenuShowing    += BandedGridViewPopupMenuShowing;
            _AdvBandedGridView.PopupMenuShowing += BandedGridViewPopupMenuShowing;

            GridLocalizer.Active = new KoreanGridLocalizer();

            Grid.DataSourceChanged += delegate(object sender, EventArgs e) { DataSourceChanged?.Invoke(sender, e); };
        }
Esempio n. 2
0
 /// <summary>
 /// A method for getting the Footer hieght. It is recommended to use this method instead of the just the Property for the Footer object
 /// because when printing we are working out size the scope of the visual automatic update tree, so this guarentees the size returned
 /// has been recalculated and is up to date.
 /// </summary>
 /// <returns>Height of Footer</returns>
 public double GetFooterHeight()
 {
     PrintFooter.Measure(new Size(double.MaxValue, double.MaxValue));
     return(PrintFooter.DesiredSize.Height);
 }