Esempio n. 1
0
        private void gridView1_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            if (e.Column == this.colDealVolume)
            {
                var selectedHandles = this.gridView1.GetSelectedRows().Where(x => x > -1);

                decimal dealVolume = 0;
                foreach (int rowHandle in selectedHandles)
                {
                    dealVolume += decimal.Parse(this.gridView1.GetRowCellValue(rowHandle, this.colDealVolume).ToString());
                }

                e.Info.DisplayText = "合计:" + dealVolume.ToString("N0");
            }
            else if (e.Column == this.colActualAmount)
            {
                var selectedHandles = this.gridView1.GetSelectedRows().Where(x => x > -1);

                decimal actualAmount = 0;
                foreach (int rowHandle in selectedHandles)
                {
                    actualAmount += decimal.Parse(this.gridView1.GetRowCellValue(rowHandle, this.colActualAmount).ToString());
                }

                e.Info.DisplayText = "合计:" + actualAmount.ToString("N4");
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 自定义表格尾部数据统计
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridView1_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            int dx = e.Bounds.Height;
            //Brush brush = e.Cache.GetGradientBrush(e.Bounds, Color.Transparent, Color.Transparent, System.Drawing.Drawing2D.LinearGradientMode.Vertical);
            Rectangle r = e.Bounds;

            r.Inflate(1, -1);
            //r.Inflate(0, -1);
            Pen   p     = new Pen(Color.LightGray);
            Brush brush = e.Cache.GetGradientBrush(e.Bounds, Color.WhiteSmoke, Color.WhiteSmoke, System.Drawing.Drawing2D.LinearGradientMode.Vertical);

            e.Graphics.FillRectangle(brush, r);
            e.Graphics.DrawRectangle(p, r.X - 1, r.Y, r.Width, r.Height);
            //e.Graphics.DrawRectangle(p, r.X - 1, r.Y, r.Width+1, r.Height);
            //ControlPaint.DrawBorder(e.Graphics, r, Color.Gray, ButtonBorderStyle.Solid);
            //r.Inflate(-1, -1);
            //e.Graphics.FillRectangle(brush, r);
            //r.Inflate(-2, 0);
            e.Appearance.DrawString(e.Cache, e.Info.DisplayText, r);
            if (firstfootcell)
            {
                //e.Graphics.DrawRectangle(p, r.X-1, r.Y, r.Width, r.Height);
                e.Appearance.DrawString(e.Cache, "总计", r);

                firstfootcell = false;
            }
            e.Handled = true;
        }
Esempio n. 3
0
 private void gridView1_CustomDrawRowFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     /*
      * if (e.Column == colORTODMGUN)
      * {
      *  //GridGroupSummaryItem
      *  //DictionaryEntry ent = currentView.GetRowSummaryItem(e.RowHandle, gridView1_CustomDrawRowFooterCell.FocusedColumn);
      *  //DictionaryEntry ent = gridView1.GetGroupSummaryValues(e.RowHandle);
      *  //GridGroupSummaryItem ccc = gridView1.GetGroupSummaryValues(e.RowHandle);
      *  //var ddd = ccc["ShowInGroupColumnFooter = TOPTUT, FieldName = 'TOPTUT', DisplayFormat = '{0:0.##}', SummaryType = Sum"];
      *  decimal aTopTut = Convert.ToDecimal(colTOPTUT.SummaryItem.SummaryValue);
      *  decimal aTopTutOdmGun = Convert.ToDecimal(colTOPTUTXODMGUN.SummaryItem.SummaryValue);
      *  Text = $"{aTopTut}   {aTopTutOdmGun}";
      *
      *  decimal tut = Convert.ToDecimal(gridView1.GetRowSummaryItem(e.RowHandle, colTOPTUT).Value);
      *  var tutOdm = Convert.ToDecimal(gridView1.GetRowSummaryItem(e.RowHandle, colTOPTUTXODMGUN).Value);
      *  decimal ortOdmGun = Math.Round(tutOdm / tut, 0);
      *  e.Info.DisplayText = $"{ortOdmGun}";
      *  //e.Info.Value = ortOdmGun;
      * }
      * else if (e.Column == colORTVDEGUN)
      * {
      *  decimal tut = Convert.ToDecimal(gridView1.GetRowSummaryItem(e.RowHandle, colTOPTUT).Value);
      *  var tutVde = Convert.ToDecimal(gridView1.GetRowSummaryItem(e.RowHandle, colTOPTUTXVDEGUN).Value);
      *  decimal ortVdeGun = Math.Round(tutVde / tut, 0);
      *  e.Info.DisplayText = $"{ortVdeGun}";
      *  //e.Info.Value = ortVdeGun;
      * }
      */
 }
Esempio n. 4
0
        private void DrawAllreadyPlannedFooterCells(DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            int value = 0;

            if (m_dailyView != null)
            {
                value = m_dailyView.TotalPlannedWorkingHours;
            }

            e.Info.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
            e.Info.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;

            e.Info.DisplayText = DateTimeHelper.IntTimeToStr(value);

            e.Painter.DrawObject(e.Info);

            value = (m_dailyView != null) ? m_dailyView.TotalPlannedHoursPerDay : 0;

            Rectangle oldBounds = e.Info.Bounds;
            string    oldText   = e.Info.DisplayText;

            e.Info.Bounds      = new Rectangle(e.Info.Bounds.Left, e.Info.Bounds.Bottom + 1, e.Info.Bounds.Width, e.Info.Bounds.Height);
            e.Info.DisplayText = FooterHoursAsString(value);

            e.Painter.DrawObject(e.Info);

            e.Info.Bounds      = oldBounds;
            e.Info.DisplayText = oldText;

            e.Handled = true;
        }
        private void gridView1_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            if (e.Column.FieldName == "Amount")
            {
                object v = e.Info.Value;
                if (!(v is decimal))
                {
                    return;
                }

                decimal d = Convert.ToDecimal(v);
                if (d <= 0)
                {
                    e.Appearance.ForeColor = Color.Red;
                }
                else if (d <= 500)
                {
                    e.Appearance.ForeColor = Color.GreenYellow;
                }
                else
                {
                    e.Appearance.ForeColor = Color.Green;
                }
            }
        }
Esempio n. 6
0
 private void gridView1_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     e.Appearance.Font      = new Font(e.Appearance.Font, FontStyle.Bold);
     e.Appearance.ForeColor = System.Drawing.Color.Red;
     //e.Appearance.FontSizeDelta = 10;
     //e.Appearance.ForeColor = System.Drawing.Color.Red;
     ////e.Graphics.FillRectangle(Brushes.Red, e.Bounds);
     //e.Appearance.DrawString(e.Cache, e.Info.DisplayText, e.Bounds);
     //e.Handled = true;
 }
Esempio n. 7
0
 /// <summary>
 /// 普通视图中自动以网格脚中的内容
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gridViewMain_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     if (_ClientRuleObject.ClientLayoutAttribute != null &&
         _ClientRuleObject.ClientLayoutAttribute.IsCustomFooterSummary &&
         _CustomFootSummaryCols != null && _CustomFootSummaryCols.Count > 0 &&
         _CustomFootSummaryCols.ContainsKey(e.Column.FieldName))
     {
         e.Info.DisplayText = _CustomFootSummaryCols[e.Column.FieldName].ToString();
     }
 }
Esempio n. 8
0
        private void gridView1_CustomDrawRowFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            decimal c1 = 0M, c2 = QUO993.SummaryItem.SummaryValue == null ? 0 : Convert.ToDecimal(QUO993.SummaryItem.SummaryValue);

            if (e.Column == this.U3)
            {
                c1 = this.gridView1.GetRowFooterCellText(e.RowHandle, this.QUO993) == string.Empty ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.QUO993));
                e.Info.DisplayText = (c1 / c2 * 100).ToString("0.##") + "%";
            }
        }
Esempio n. 9
0
 private void GVDSC_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     if (e.Column.FieldName == "SoTienBaoLuu")
     {
         e.Info.DisplayText = iGiaThu.ToString("#,##0");
     }
     else if (e.Column.FieldName == "MaCho")
     {
         e.Info.DisplayText = GVDSC.GetSelectedRows().Count().ToString();
     }
 }
Esempio n. 10
0
        private void DrawHourlyFooter(TimeColumnInfo columnInfo, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            int        value         = (m_dailyView != null) ? m_dailyView.GetTotals(columnInfo.FromTime, CurrentView) : 0;
            RectangleF oldClipBounds = e.Graphics.ClipBounds;
            Rectangle  newClipBounds = Rectangle.Round(oldClipBounds);

            newClipBounds.Height = e.Bounds.Height * 2 + 1;

            DevExpress.Utils.Paint.Clipping        clip   = null;
            System.Drawing.Drawing2D.GraphicsState GState = null;
            bool bClipping = false;

            try
            {
                if (newClipBounds.Height > oldClipBounds.Height)// if need change clip region
                {
                    GState          = e.Graphics.Save();
                    e.Graphics.Clip = new System.Drawing.Region(newClipBounds);
                    clip            = new DevExpress.Utils.Paint.Clipping();
                    clip.SetClipAPI(new GraphicsInfoArgs(e.Cache, newClipBounds), newClipBounds);
                    bClipping = true;
                }

                e.Info.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
                e.Info.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;

                e.Info.DisplayText = DateTimeHelper.IntTimeToStr(value);
                e.Painter.DrawObject(e.Info);


                Rectangle oldBounds = e.Info.Bounds;
                string    oldText   = e.Info.DisplayText;
                e.Info.Bounds      = new Rectangle(e.Info.Bounds.Left, e.Info.Bounds.Bottom + 1, e.Info.Bounds.Width, e.Info.Bounds.Height);
                e.Info.DisplayText = FooterHoursAsString(value);


                e.Painter.DrawObject(e.Info);
                e.Info.Bounds      = oldBounds;
                e.Info.DisplayText = oldText;
            }
            finally
            {
                if (bClipping)
                {
                    clip.RestoreClipAPI(e.Graphics);
                    e.Graphics.Restore(GState);
                    e.Graphics.SetClip(oldClipBounds);
                    GState = null;
                    clip   = null;
                }
            }
            e.Handled = true;
        }
Esempio n. 11
0
        private void gridView1_CustomDrawRowFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            decimal dOne = 0M, dTwo = 0M, dTre = 0M;

            if (e.Column == this.U0)
            {
                //([DM006]+[DM009]) * 1.0 / [DM005]
                dOne = this.gridView1.GetRowFooterCellText(e.RowHandle, this.DM005) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.DM005));
                dTwo = this.gridView1.GetRowFooterCellText(e.RowHandle, this.DM006) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.DM006));
                dTre = this.gridView1.GetRowFooterCellText(e.RowHandle, this.DM009) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.DM009));
                e.Info.DisplayText = dOne == 0 ? (0.0).ToString( ) + "%" : (Math.Round(Convert.ToDecimal((dTwo + dTre) * Convert.ToDecimal(1.0) / dOne) * 100, 1)).ToString( ) + "%";
            }
        }
Esempio n. 12
0
        private void gridView1_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            int       dx    = e.Bounds.Height;
            Brush     brush = e.Cache.GetGradientBrush(e.Bounds, Color.Wheat, Color.FloralWhite, LinearGradientMode.Vertical);
            Rectangle r     = e.Bounds;

            ControlPaint.DrawBorder3D(e.Graphics, r, Border3DStyle.RaisedInner);
            r.Inflate(-1, -1);
            e.Graphics.FillRectangle(brush, r);
            r.Inflate(-2, 0);
            e.Appearance.DrawString(e.Cache, e.Info.DisplayText, r);
            e.Handled = true;
        }
Esempio n. 13
0
        //private void gridView5_CustomSummaryCalculate(object sender, DevExpress.Data.CustomSummaryEventArgs e)
        //{
        //    if (gridColumn3.SummaryItem.SummaryValue != null)
        //         textEdit5.Text = gridColumn3.SummaryItem.SummaryValue.ToString();

        //    if (gridColumn78.SummaryItem.SummaryValue != null)
        //        textEdit6.Text = gridColumn78.SummaryItem.SummaryValue.ToString();
        //}

        private void gridView5_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            if (gridColumn3.SummaryItem.SummaryValue != null)
            {
                textEdit5.Text = gridColumn3.SummaryText;
            }
            //.SummaryItem.SummaryValue.ToString();

            if (gridColumn78.SummaryItem.SummaryValue != null)
            {
                textEdit6.Text = gridColumn78.SummaryText;
            }
            //.SummaryItem.SummaryValue.ToString();
        }
Esempio n. 14
0
        private void myGridView1_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            bool isPrinting = e.Handled;

            e.Handled = true;
            e.Appearance.BackColor = Color.Yellow;
            e.Appearance.FillRectangle(e.Cache, e.Bounds);
            Rectangle rect = e.Bounds;

            rect.Width = rect.Height;
            e.Appearance.FillRectangle(e.Cache, rect);
            e.Cache.DrawLine(e.Cache.GetPen(Color.Red, 3), new Point(rect.X, rect.Y), new Point(rect.Right, rect.Bottom));
            e.Cache.DrawEllipse(e.Cache.GetPen(Color.Red, 3), rect);
            e.Cache.DrawString("Custom Draw", AppearanceObject.DefaultFont, Brushes.Black, e.Bounds);
        }
Esempio n. 15
0
 private void gridView1_CustomDrawRowFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     table = _bll.getTableGroupSum( );
     foreach (DevExpress.XtraGrid.Columns.GridColumn column in gridView1.Columns)
     {
         if (e.Column == column && (column.FieldName != "产线编号" || column.FieldName != "产线" || column.FieldName != "主件品号" || column.FieldName != "主件品名" || column.FieldName != "排产量" || column.FieldName != "总排量"))
         {
             model.PRG001 = gridView1.GetDataRow(e.RowHandle) ["主件品号"].ToString( );
             if (table.Select("PRG001='" + model.PRG001 + "' AND PRG002='" + column.FieldName + "'").Length < 1)
             {
                 return;
             }
             model.PRG001       = table.Select("PRG001='" + model.PRG001 + "' AND PRG002='" + column.FieldName + "'") [0] ["PRG006"].ToString( );
             e.Info.DisplayText = model.PRG001;
         }
     }
 }
Esempio n. 16
0
        private void gridView_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            TimeColumnInfo columnInfo = e.Column.Tag as TimeColumnInfo;

            if (columnInfo != null)
            {
                DrawHourlyFooter(columnInfo, e);
            }
            else if (e.Column == gc_Employee /*|| e.Column == gc_HWGR*/)
            {
                DrawHeaderFooter(e);
            }
            else if (e.Column == gc_AllreadyPlannedWorkingHours)
            {
                DrawAllreadyPlannedFooterCells(e);
            }
        }
Esempio n. 17
0
 private void gridView1_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     if (e.Column == gcPayment)
     {
         int indent = 5;
         e.Info.DisplayText = string.Empty;
         e.Painter.DrawObject(e.Info);
         Rectangle r = e.Info.Bounds;
         r.Inflate(-indent, 0);
         using (StringFormat sf = new StringFormat()) {
             sf.Alignment     = StringAlignment.Near;
             sf.LineAlignment = StringAlignment.Center;
             e.Appearance.DrawString(e.Cache, string.Format("{0:c2}", customSum.InterestSum), r, sf);
             sf.Alignment = StringAlignment.Far;
             e.Appearance.DrawString(e.Cache, string.Format("{0:c2}", customSum.PrincipalSum), r, sf);
         }
         e.Handled = true;
     }
 }
Esempio n. 18
0
        private void DrawHeaderFooter(DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            e.Painter.DrawObject(e.Info);

            int iWidth = (gc_HWGR.Visible) ? gc_HWGR.Width : 0;

            Rectangle oldBounds = e.Info.Bounds;
            string    oldText   = e.Info.DisplayText;

            e.Info.Bounds = new Rectangle(e.Info.Bounds.Left, e.Info.Bounds.Bottom + 1, e.Info.Bounds.Width + iWidth, e.Info.Bounds.Height);

            e.Info.DisplayText = _NUMBER_OF_PEOPLE_ROW;
            DevExpress.Utils.HorzAlignment oldHAlignment = e.Info.Appearance.TextOptions.HAlignment;
            e.Info.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
            e.Painter.DrawObject(e.Info);
            e.Info.Bounds      = oldBounds;
            e.Info.DisplayText = oldText;
            e.Info.Appearance.TextOptions.HAlignment = oldHAlignment;
            e.Handled = true;
        }
Esempio n. 19
0
        private void gridView1_CustomDrawRowFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            decimal d1 = 0M, d2 = 0M, d3 = 0M;

            if (e.Column == this.CP)
            {
                d1 = d2 = d3 = 0M;
                d1 = this.gridView1.GetRowFooterCellText(e.RowHandle, this.BZ) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.BZ));
                d2 = this.gridView1.GetRowFooterCellText(e.RowHandle, this.GK) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.GK));
                d3 = d2 == 0 ? 0 : Math.Round(Convert.ToDecimal(d1 / d2) * 100, 0);
                e.Info.DisplayText = d3.ToString( ) + "%";
            }
            if (e.Column == this.CL)
            {
                d1 = d2 = d3 = 0M;
                d1 = this.gridView1.GetRowFooterCellText(e.RowHandle, this.BZ) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.BZ));
                d2 = this.gridView1.GetRowFooterCellText(e.RowHandle, this.NP) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.NP));
                d3 = d2 == 0 ? 0 : Math.Round(Convert.ToDecimal(d1 / d2) * 100, 0);
                e.Info.DisplayText = d3.ToString( ) + "%";
            }
        }
Esempio n. 20
0
        /// <summary>
        /// 분양 달성률 합계
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bandedGridView_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            try
            {
                if (this.bandedGridView.RowCount <= 0)
                {
                    return;
                }

                if (e.Info.Column.Equals(this.bandedGridView.Columns["TOTAL_PER"]))
                {
                    e.Info.DisplayText = "0";

                    //Filter 가 걸렸을때 현재 Display 된 로우만 가지고 계산해야 되기대문에
                    //현재 그리드에 있는 Row 값만 축출한다.
                    DataTable CDataTable = Cls.Grid.Options.GetGridData(this.grid);

                    string strSumTotalPay = CDataTable.Compute("SUM(TOTAL_PAY_AMT)", "").ToString();
                    string strSumPlanAmt  = CDataTable.Compute("SUM(PLAN_AMT)", "").ToString();

                    strSumTotalPay = strSumTotalPay.Equals("") ? "0" : strSumTotalPay;
                    strSumPlanAmt  = strSumPlanAmt.Equals("") ? "0" : strSumPlanAmt;

                    //백분율을 낸다.
                    //(strSumTotalPay/strSumPlanAmt) * 100
                    //제수가 0면 에러기때문에 빠져나간다.
                    if (strSumPlanAmt.Equals("0"))
                    {
                        return;
                    }

                    e.Info.DisplayText = Math.Round((double.Parse(strSumTotalPay) / double.Parse(strSumPlanAmt)) * 100, 2).ToString();
                }
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
        }
Esempio n. 21
0
        private void gridView2_CustomDrawRowFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            Decimal dOne = 0M, dTwo = 0M, dTre = 0M;

            if (e.Column == this.H6)
            {
                dOne = this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ005) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ005));
                dTwo = this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ011) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ011));
                e.Info.DisplayText = (dOne - dTwo).ToString( );
            }
            if (e.Column == this.H7)
            {
                dOne = this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ005) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ005));
                dTwo = this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ011) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ011));
                dTre = dOne == 0 ? 0 : Math.Round(dTwo / dOne * 100, 1);
                e.Info.DisplayText = dTre.ToString( ) + "%";
            }
            if (e.Column == this.H9)
            {
                dOne = this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ005) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ005));
                dTwo = this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ012) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ012));
                e.Info.DisplayText = (dOne - dTwo).ToString( );
            }
            if (e.Column == this.H10)
            {
                dOne = this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ005) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ005));
                dTwo = this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ012) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ012));
                dTre = dOne == 0 ? 0 : Math.Round(dTwo / dOne * 100, 1);
                e.Info.DisplayText = dTre.ToString( ) + "%";
            }
            if (e.Column == this.H11)
            {
                dOne = this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ004) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ004));
                dTwo = this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ012) == "" ? 0 : Convert.ToDecimal(this.gridView1.GetRowFooterCellText(e.RowHandle, this.SZ012));
                dTre = dOne == 0 ? 0 : Math.Round(dTwo / dOne * 100, 1);
                e.Info.DisplayText = dTre.ToString( ) + "%";
            }
        }
Esempio n. 22
0
 private void grdvDeliveryBook_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     if (e.Column.FieldName == "TenNXB")
     {
         bool isPrinting = e.Handled;
         e.Handled = true;
         //e.Appearance.BackColor = Color.Violet;
         //e.Appearance.FillRectangle(e.Cache, e.Bounds);
         e.Graphics.DrawString("\tTổng số lượng ", AppearanceObject.DefaultFont, Brushes.Blue, e.Bounds);
     }
     else if (e.Column.FieldName == "DonGia")
     {
         bool isPrinting = e.Handled;
         e.Handled = true;
         //e.Appearance.BackColor = Color.Violet;//Chọn màu cho cột
         //e.Appearance.FillRectangle(e.Cache, e.Bounds);
         e.Graphics.DrawString("\tTổng số tiền ", AppearanceObject.DefaultFont, Brushes.Blue, e.Bounds);
     }
     else
     {
         return;
     }
 }
Esempio n. 23
0
        private void bandedGridView1_CustomDrawRowFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            if (tableQuery == null || tableQuery.Rows.Count < 1)
            {
                return;
            }
            _model.QZ001 = tableQuery.Rows[0]["QZ001"].ToString( );
            DataTable de = _bll.GetDataTableOfGroupSum(_model.QZ001);

            if (de != null && de.Rows.Count > 0)
            {
                if (de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'").Length > 0)
                {
                    if (e.Column == this.QZ006)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["QZ006"].ToString( );
                    }
                    if (e.Column == this.QZ007)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["QZ007"].ToString( );
                    }
                    if (e.Column == this.QZ008)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["QZ008"].ToString( );
                    }
                    if (e.Column == this.U22)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U22"].ToString( );
                    }
                    if (e.Column == this.U0)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U0"].ToString( );
                    }
                    if (e.Column == this.U23)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U23"].ToString( );
                    }
                    if (e.Column == this.U1)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U1"].ToString( );
                    }
                    if (e.Column == this.QZ014)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["QZ014"].ToString( );
                    }
                    if (e.Column == this.U4)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U4"].ToString( );
                    }
                    if (e.Column == this.QZ013)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["QZ013"].ToString( );
                    }
                    if (e.Column == this.U5)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U5"].ToString( );
                    }
                    if (e.Column == this.U6)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U6"].ToString( );
                    }
                    if (e.Column == this.U3)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U3"].ToString( );
                    }
                    if (e.Column == this.U24)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U24"].ToString( );
                    }
                    if (e.Column == this.U7)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U7"].ToString( );
                    }
                    if (e.Column == this.U9)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U9"].ToString( );
                    }
                    if (e.Column == this.U10)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U10"].ToString( );
                    }
                    if (e.Column == this.U11)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U11"].ToString( );
                    }
                    if (e.Column == this.U12)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U12"].ToString( );
                    }
                    if (e.Column == this.QZ019)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["QZ019"].ToString( );
                    }
                    if (e.Column == this.U13)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U13"].ToString( );
                    }
                    if (e.Column == this.QZ021)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["QZ021"].ToString( );
                    }
                    if (e.Column == this.U14)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U14"].ToString( );
                    }
                    if (e.Column == this.QZ023)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["QZ023"].ToString( );
                    }
                    if (e.Column == this.U15)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U15"].ToString( );
                    }
                    if (e.Column == this.QZ025)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["QZ025"].ToString( );
                    }
                    if (e.Column == this.U16)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U16"].ToString( );
                    }
                    if (e.Column == this.QZ027)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["QZ027"].ToString( );
                    }
                    if (e.Column == this.U17)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U17"].ToString( );
                    }
                    if (e.Column == this.QZ029)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["QZ029"].ToString( );
                    }
                    if (e.Column == this.U18)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U18"].ToString( );
                    }
                    if (e.Column == this.U19)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U19"].ToString( );
                    }
                    if (e.Column == this.U20)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U20"].ToString( );
                    }
                    if (e.Column == this.U21)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["U21"].ToString( );
                    }
                    if (e.Column == this.QZ039)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle)["QZ003"].ToString( ) + "'")[0]["QZ039"].ToString( );
                    }
                    if (e.Column == this.QZ046)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle) ["QZ003"].ToString( ) + "'") [0] ["QZ046"].ToString( );
                    }
                    if (e.Column == this.QZ048)
                    {
                        e.Info.DisplayText = de.Select("QZ003='" + bandedGridView1.GetDataRow(e.RowHandle) ["QZ003"].ToString( ) + "'") [0] ["QZ048"].ToString( );
                    }
                }
            }
        }
Esempio n. 24
0
 private void grdIGView_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     e.Info.Column.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
     e.Info.Column.DisplayFormat.FormatString = BsfGlobal.g_sDigitFormat;
 }
Esempio n. 25
0
 private void GridView1_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     e.Appearance.BackColor = Color.White;
     e.Appearance.ForeColor = Color.Red;
 }
Esempio n. 26
0
 private void gridView_CTPN_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     txt_TongCong.Text = e.Info.DisplayText;
 }
Esempio n. 27
0
 private void gridView1_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     e.Appearance.Font      = new Font(e.Appearance.Font, FontStyle.Bold);
     e.Appearance.ForeColor = System.Drawing.Color.Red;
 }
Esempio n. 28
0
 private void myGridView1_GetFooterCellDisplayText(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     e.Info.DisplayText = myFooterText;
 }