Esempio n. 1
0
 void BGV_ListRowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     if (e.Clicks >= 2 && (e.Column.FieldName.SameText("sale_foreign_amount") ||
                           e.Column.FieldName.SameText("sale_native_amount") ||
                           e.Column.FieldName.SameText("supply_foreign_amount") ||
                           e.Column.FieldName.SameText("supply_native_amount") ||
                           e.Column.FieldName.SameText("receipt_foreign_amount") ||
                           e.Column.FieldName.SameText("receipt_native_amount") ||
                           e.Column.FieldName.SameText("consign_foreign_amount") ||
                           e.Column.FieldName.SameText("consign_native_amount")))
     {
         Controller.MakeDetailCndt(e.Column.FieldName, BGV_List.GetFocusedDataSourceRowIndex());
     }
 }
Esempio n. 2
0
 void BGV_ListCustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
 {
     // Added by gyc 2018-11-27 10:23:46  当该客户有预收、预付金额时,增加颜色标记
     if (e.Column == col_receipt_money)
     {
         if (Convert.ToDouble(BGV_List.GetDataRow(e.RowHandle)["receipt_money"]) > 0 &&
             e.RowHandle != BGV_List.GetRowHandle(BGV_List.GetFocusedDataSourceRowIndex()))
         {
             e.Appearance.ForeColor = Color.Black;
             e.Appearance.BackColor = Color.SkyBlue;
         }
     }
     else if (e.Column == col_consign_money)
     {
         if (Convert.ToDouble(BGV_List.GetDataRow(e.RowHandle)["consign_money"]) > 0 &&
             e.RowHandle != BGV_List.GetRowHandle(BGV_List.GetFocusedDataSourceRowIndex()))
         {
             e.Appearance.ForeColor = Color.Black;
             e.Appearance.BackColor = Color.SkyBlue;
         }
     }
     // End of Added
 }
Esempio n. 3
0
        void DoShowThingGVList()
        {
            if (BGV_List == null || BGV_List.RowCount == 0 || BGV_List.FocusedRowHandle < 0)
            {
                return;
            }

            Control l_frmOwner = BGV_List.GridControl;

            DevExpress.XtraGrid.Views.Grid.Handler.GridHandler l_gh
                         = new DevExpress.XtraGrid.Views.Grid.Handler.GridHandler(BGV_List);
            m_PtLocation = Control.MousePosition;
            m_PtLocation = BGV_List.GridControl.PointToClient(m_PtLocation);
            GridHitInfo l_downHitInfo = l_gh.ViewInfo.CalcHitInfo(m_PtLocation);

            if (l_downHitInfo.InRowCell && l_downHitInfo.HitTest == GridHitTest.RowCell &&
                (l_downHitInfo.Column.Equals(col_surplus_foreign_amount) || l_downHitInfo.Column.Equals(col_surplus_native_amount)))
            {
                int l_rowHandle = BGV_List.GetDataSourceRowIndex(l_downHitInfo.RowHandle);
                int l_colHandle = l_downHitInfo.Column.ColumnHandle;
                if (l_rowHandle < 0 || l_colHandle < 0)
                {
                    return;
                }

                //判断重复执行
                string l_strCellIn = l_colHandle.ToString() + ":" + l_rowHandle.ToString();
                //如果是同一个单元格,则忽略
                if (m_strLastCell.Equals(l_strCellIn))
                {
                    return;
                }
                else
                {
                    m_strLastCell = l_strCellIn;
                }

                DataTable l_tbSource = BGV_List.GridControl.DataSource as DataTable;
                string    l_strField = l_downHitInfo.Column.FieldName;

                //构造浮窗上显示的内容
                string l_strHint = "期末=期初+销售发票-收款-采购发票+付款-调差";

                Rectangle l_cellRect = l_gh.ViewInfo.GetGridCellInfo(l_downHitInfo).CellValueRect;
                Point     l_pt       = BGV_List.GridControl.PointToScreen(new Point(l_cellRect.X, l_cellRect.Y + l_cellRect.Height + 1));

                l_pt = Control.MousePosition;
                l_pt = l_frmOwner.PointToClient(l_pt);
                if (BGV_List.OptionsHint.ShowCellHints)
                {
                    BGV_List.OptionsHint.ShowCellHints = false;
                }
                ShowHint(l_strHint, l_frmOwner, l_pt);
            }
            else if (l_downHitInfo.HitTest != GridHitTest.RowCell)
            {
                m_strLastCell = "";
                m_strLastHint = "";
                m_Hint.Hide(BGV_List.GridControl);
            }
        }
Esempio n. 4
0
 void MI_AdjustClick(object sender, EventArgs e)
 {
     Controller.CallAdjust(BGV_List.GetFocusedDataSourceRowIndex());
 }