Пример #1
0
        /// <summary>
        /// 设置Grid单元格合并
        /// </summary>
        private void gridViewWNowInfo_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            try
            {
                GridView view = sender as GridView;
                string   firstColumnFieldName = "CodeFileName";

                switch (e.Column.FieldName)
                {
                case "CodeName":
                case "CodeNo":
                case "CodeSpec":
                case "Brand":
                case "CatgName":
                case "MaterialVersion":
                case "CodeWeight":
                {
                    string valueFirstColumn1 = Convert.ToString(view.GetRowCellValue(e.RowHandle1, firstColumnFieldName));
                    string valueFirstColumn2 = Convert.ToString(view.GetRowCellValue(e.RowHandle2, firstColumnFieldName));
                    string valueOtherColumn1 = Convert.ToString(view.GetRowCellValue(e.RowHandle1, e.Column.FieldName));
                    string valueOtherColumn2 = Convert.ToString(view.GetRowCellValue(e.RowHandle2, e.Column.FieldName));
                    e.Merge   = valueFirstColumn1 == valueFirstColumn2 && valueOtherColumn1 == valueOtherColumn2;
                    e.Handled = true;
                }
                break;
                }
            }
            catch (Exception ex)
            {
                //ExceptionHandler.HandleException(this.Text + "--设置Grid单元格合并错误。", ex);
                ExceptionHandler.HandleException(this.Text + "--" + f.tsmiSzgriddyghbcw.Text, ex);
            }
        }
Пример #2
0
        /// <summary>
        /// 设置Grid单元格合并
        /// </summary>
        private void gridViewDeliveryDetail_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            try
            {
                GridView view = sender as GridView;
                string   firstColumnFieldName = "AutoId";

                switch (e.Column.FieldName)
                {
                case "DeliveryText":
                case "FunctionDesc":
                case "Unit":
                case "DeliveryQty":
                case "Amount":
                case "Creator":
                {
                    string valueFirstColumn1 = Convert.ToString(view.GetRowCellValue(e.RowHandle1, firstColumnFieldName));
                    string valueFirstColumn2 = Convert.ToString(view.GetRowCellValue(e.RowHandle2, firstColumnFieldName));
                    string valueOtherColumn1 = Convert.ToString(view.GetRowCellValue(e.RowHandle1, e.Column.FieldName));
                    string valueOtherColumn2 = Convert.ToString(view.GetRowCellValue(e.RowHandle2, e.Column.FieldName));
                    e.Merge   = valueFirstColumn1 == valueFirstColumn2 && valueOtherColumn1 == valueOtherColumn2;
                    e.Handled = true;
                }
                break;
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(this.Text + "--设置Grid单元格合并错误。", ex);
            }
        }
Пример #3
0
        /// <summary>
        /// 设置Grid单元格合并
        /// </summary>
        private void gridViewStnSummaryList_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            try
            {
                GridView view = sender as GridView;
                string   firstColumnFieldName = "AutoId";

                switch (e.Column.FieldName)
                {
                case "StnNo":
                case "StnDesc":
                case "GetTime":
                case "Prepared":
                {
                    string valueFirstColumn1 = Convert.ToString(view.GetRowCellValue(e.RowHandle1, firstColumnFieldName));
                    string valueFirstColumn2 = Convert.ToString(view.GetRowCellValue(e.RowHandle2, firstColumnFieldName));
                    string valueOtherColumn1 = Convert.ToString(view.GetRowCellValue(e.RowHandle1, e.Column.FieldName));
                    string valueOtherColumn2 = Convert.ToString(view.GetRowCellValue(e.RowHandle2, e.Column.FieldName));
                    e.Merge   = valueFirstColumn1 == valueFirstColumn2 && valueOtherColumn1 == valueOtherColumn2;
                    e.Handled = true;
                }
                break;
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(this.Text + "--设置Grid单元格合并错误。", ex);
            }
        }
Пример #4
0
        /// <summary>
        /// 设置Grid单元格合并
        /// </summary>
        private void gridViewUserWorkFlow_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            try
            {
                GridView view = sender as GridView;
                string   firstColumnFieldName = "DataNo";

                switch (e.Column.FieldName)
                {
                case "CurrentState":
                case "CurrentNodeId":
                case "ApproverLevel":
                {
                    string valueFirstColumn1 = Convert.ToString(view.GetRowCellValue(e.RowHandle1, firstColumnFieldName));
                    string valueFirstColumn2 = Convert.ToString(view.GetRowCellValue(e.RowHandle2, firstColumnFieldName));
                    string valueOtherColumn1 = Convert.ToString(view.GetRowCellValue(e.RowHandle1, e.Column.FieldName));
                    string valueOtherColumn2 = Convert.ToString(view.GetRowCellValue(e.RowHandle2, e.Column.FieldName));
                    e.Merge   = valueFirstColumn1 == valueFirstColumn2 && valueOtherColumn1 == valueOtherColumn2;
                    e.Handled = true;
                }
                break;
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(this.Text + "--设置Grid单元格合并错误。", ex);
            }
        }
Пример #5
0
        /// <summary>
        /// 设置Grid单元格合并
        /// </summary>
        private void gridViewStnSummaryList_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            //try
            //{
            //    GridView view = sender as GridView;
            //    string firstColumnFieldName = "AutoId";

            //    switch (e.Column.FieldName)
            //    {
            //        case "StnNo":
            //        case "StnDesc":
            //        case "GetTime":
            //        case "Creator":
            //            {
            //                string valueFirstColumn1 = Convert.ToString(view.GetRowCellValue(e.RowHandle1, firstColumnFieldName));
            //                string valueFirstColumn2 = Convert.ToString(view.GetRowCellValue(e.RowHandle2, firstColumnFieldName));
            //                string valueOtherColumn1 = Convert.ToString(view.GetRowCellValue(e.RowHandle1, e.Column.FieldName));
            //                string valueOtherColumn2 = Convert.ToString(view.GetRowCellValue(e.RowHandle2, e.Column.FieldName));
            //                e.Merge = valueFirstColumn1 == valueFirstColumn2 && valueOtherColumn1 == valueOtherColumn2;
            //                e.Handled = true;
            //            }
            //            break;
            //    }
            //}
            //catch (Exception ex)
            //{
            //    ExceptionHandler.HandleException(this.Text + "--设置Grid单元格合并错误。", ex);
            //}
        }
Пример #6
0
 private void gridView1_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
 {
     if ((this.gridView1.GetDataRow(e.RowHandle1)["iID"].ToString() != this.gridView1.GetDataRow(e.RowHandle2)["iID"].ToString()))
     {
         e.Handled = true;
     }
 }
Пример #7
0
        private void gvProduction_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            GridView view = sender as GridView;

            if (e.Column.FieldName == "ProductionQty")// || e.Column.FieldName == "BillQty" || e.Column.FieldName == "RemQty" || e.Column.FieldName == "Rack" || e.Column.FieldName == "Quantity")
            {
                string val1 = e.CellValue1.ToString();
                string val2 = e.CellValue2.ToString();

                string value3 = view.GetRowCellValue(e.RowHandle1, view.Columns["ProductID"]).ToString();
                string value4 = view.GetRowCellValue(e.RowHandle2, view.Columns["ProductID"]).ToString();

                e.Merge   = (val1 == val2 && value3 == value4);
                e.Handled = true;
                return;
            }
            else if (e.Column.FieldName == "ProductUnit")// || e.Column.FieldName == "BillQty" || e.Column.FieldName == "RemQty" || e.Column.FieldName == "Rack" || e.Column.FieldName == "Quantity")
            {
                string val1 = e.CellValue1.ToString();
                string val2 = e.CellValue2.ToString();

                string value3 = view.GetRowCellValue(e.RowHandle1, view.Columns["ProductID"]).ToString();
                string value4 = view.GetRowCellValue(e.RowHandle2, view.Columns["ProductID"]).ToString();

                e.Merge   = (val1 == val2 && value3 == value4);
                e.Handled = true;
                return;
            }
        }
Пример #8
0
        private void dgv_Main_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            GridView   view         = sender as GridView;
            GridColumn colCreatorID = dgv_Main.Columns["CompanyName"];

            if (view == null)
            {
                return;
            }
            if (e.Column == colCreatorID)
            {
                string text1 = view.GetRowCellDisplayText(e.RowHandle1, colCreatorID);
                string text2 = view.GetRowCellDisplayText(e.RowHandle2, colCreatorID);
                e.Merge   = (text1 == text2);
                e.Handled = true;
            }
            //if (e.Column.FieldName == "CompanyName")
            //{
            //    GridView view = sender as GridView;
            //    DateTime val1 = (DateTime)view.GetRowCellValue(e.RowHandle1, e.Column);
            //    DateTime val2 = (DateTime)view.GetRowCellValue(e.RowHandle2, e.Column);
            //    e.Merge = val1.Date == val2.Date;
            //    e.Handled = true;
            //}
        }
Пример #9
0
 private void gridView1_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
 {
     if (e.Column == colTenNV)
     {
         string text1 = gridView1.GetRowCellDisplayText(e.RowHandle1, colTenNV);
         string text2 = gridView1.GetRowCellDisplayText(e.RowHandle2, colTenNV);
         e.Merge   = (text1 == text2);
         e.Handled = true;
     }
 }
Пример #10
0
 private void gridView1_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
 {
     //if (e.Column.FieldName == "Name")
     //{
     //    GridView view = sender as GridView;
     //    string val1 = (string)view.GetRowCellValue(e.RowHandle1, e.Column);
     //    string val2 = (string)view.GetRowCellValue(e.RowHandle2, e.Column);
     //    e.Merge = val1 == val2;
     //    e.Handled = true;
     //}
 }
Пример #11
0
        /// <summary>
        /// 合并行
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gvPrjAmountPayRpt_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            PrjAmountPayRpt row1 = gvPrjAmountPayRpt.GetRow(e.RowHandle1) as PrjAmountPayRpt;
            PrjAmountPayRpt row2 = gvPrjAmountPayRpt.GetRow(e.RowHandle2) as PrjAmountPayRpt;

            if (row1 != null && row2 != null && (row1.Type != row2.Type && row1.Type != 1 || DataSource.IsNewData && row1.Type == 3))
            {
                e.Merge   = false;
                e.Handled = true;
            }
        }
Пример #12
0
        private void bandedGridView1_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            GridView view = sender as GridView;

            if (e.Column.FieldName == "IDKhachHang" || e.Column.FieldName == "NVGiaoDich" || e.Column.FieldName == "NhaCungCap")
            {
                string _mark3 = (view.GetRowCellValue(e.RowHandle1, e.Column) ?? string.Empty).ToString();
                string _mark4 = (view.GetRowCellValue(e.RowHandle2, e.Column) ?? string.Empty).ToString();
                e.Merge   = _mark3 == _mark4;
                e.Handled = true;
            }
        }
Пример #13
0
 /// <summary>
 /// 合并单元格
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gvResult_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
 {
     //if (e.Column.FieldName != "Key")
     //{
     //    e.Merge = false;
     //    e.Handled = true;
     //}
     //if (e.Column.FieldName != "Depth")
     //{
     //    e.Merge = false;
     //    e.Handled = true;
     //}
 }
Пример #14
0
        private void gvPrjAmountWbsBoiRpt_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            GridView view = sender as GridView;
            string   firstColumnFieldName = "ItemNo";

            if (e.Column.FieldName == "IItemCoe" || e.Column.FieldName == "ItemName" ||
                e.Column.FieldName == "Uom" || e.Column.FieldName == "Price")
            {
                string valueFirstColumn1 = Convert.ToString(view.GetRowCellValue(e.RowHandle1, view.Columns[firstColumnFieldName]));
                string valueFirstColumn2 = Convert.ToString(view.GetRowCellValue(e.RowHandle2, view.Columns[firstColumnFieldName]));
                e.Merge   = valueFirstColumn1 == valueFirstColumn2;
                e.Handled = true;
            }
        }
Пример #15
0
 private void gridView1_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
 {
     if (e.Column.FieldName == "orderPrice")
     {
         GridView gridView = sender as GridView;
         if (gridView != null)
         {
             Decimal value1 = (Decimal)gridView1.GetRowCellValue(e.RowHandle1, e.Column);
             Decimal value2 = (Decimal)gridView1.GetRowCellValue(e.RowHandle2, e.Column);
             e.Merge   = value1 == value2;
             e.Handled = true;
         }
     }
 }
Пример #16
0
        private void GvExport_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            String result1 = GetPreValue(gvExport, e.Column, e.RowHandle1);
            String result2 = GetPreValue(gvExport, e.Column, e.RowHandle2);

            if (String.Equals(result1, result2))
            {
                e.Merge = true;
            }
            else
            {
                e.Merge = false;
            }
        }
Пример #17
0
        private void gridView1_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            int    rowOne   = e.RowHandle1;
            int    rowTwo   = e.RowHandle2;
            string valueOne = gridView1.GetDataRow(rowOne)["JZ007"].ToString( );
            string valueTwo = gridView1.GetDataRow(rowTwo)["JZ007"].ToString( );
            string valueTre = gridView1.GetDataRow(rowOne)["JZ008"].ToString( );
            string valueFor = gridView1.GetDataRow(rowTwo)["JZ008"].ToString( );
            string valueSix = gridView1.GetDataRow(rowOne)["JZ009"].ToString( );
            string valueSev = gridView1.GetDataRow(rowTwo)["JZ009"].ToString( );

            if (valueOne + valueTre + valueSix != valueTwo + valueFor + valueSev)
            {
                e.Handled = true;
            }
        }
Пример #18
0
        private void gridView1_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            GridView view = sender as GridView;

            try
            {
                if ((e.Column.FieldName == "CategoryID"))
                {
                    int value1 = Convert.ToInt32(view.GetRowCellValue(e.RowHandle1, e.Column));
                    int value2 = Convert.ToInt32(view.GetRowCellValue(e.RowHandle2, e.Column));

                    e.Merge   = (value1 == value2);
                    e.Handled = true;
                    return;
                }
            }
            catch (Exception ex)
            {
            }
        }
Пример #19
0
        private void GVHD_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            GridView view = sender as GridView;

            if (e.Column.FieldName == "HanhTrinhVe" || e.Column.FieldName == "HanhTrinhDi" || e.Column.FieldName == "SoVe")
            {
                string _mark  = (view.GetRowCellValue(e.RowHandle1, "MaCho") ?? string.Empty).ToString();
                string _mark2 = (view.GetRowCellValue(e.RowHandle2, "MaCho") ?? string.Empty).ToString();
                string _mark3 = (view.GetRowCellValue(e.RowHandle1, e.Column) ?? string.Empty).ToString();
                string _mark4 = (view.GetRowCellValue(e.RowHandle2, e.Column) ?? string.Empty).ToString();
                e.Merge   = _mark == _mark2 && _mark3 == _mark4;
                e.Handled = true;
            }
            else if (e.Column.FieldName == "CongTy")
            {
                string _mark  = (view.GetRowCellValue(e.RowHandle1, "MaHD") ?? string.Empty).ToString();
                string _mark2 = (view.GetRowCellValue(e.RowHandle2, "MaHD") ?? string.Empty).ToString();
                string _mark3 = (view.GetRowCellValue(e.RowHandle1, e.Column) ?? string.Empty).ToString();
                string _mark4 = (view.GetRowCellValue(e.RowHandle2, e.Column) ?? string.Empty).ToString();
                e.Merge   = _mark == _mark2 && _mark3 == _mark4;
                e.Handled = true;
            }
        }
Пример #20
0
        /// <summary>
        /// 设置Grid单元格合并
        /// </summary>
        private void gridViewPrReqList_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
        {
            try
            {
                GridView view = sender as GridView;
                string   firstColumnFieldName = "AutoId";

                switch (e.Column.FieldName)
                {
                case "PrReqNo":
                case "ReqState":
                case "ReqDate":
                case "CodeFileName":
                case "CodeName":
                case "Qty":
                case "ProjectNo":
                case "StnNo":
                case "ReqDep":
                case "PurCategory":
                {
                    string valueFirstColumn1 = Convert.ToString(view.GetRowCellValue(e.RowHandle1, firstColumnFieldName));
                    string valueFirstColumn2 = Convert.ToString(view.GetRowCellValue(e.RowHandle2, firstColumnFieldName));
                    string valueOtherColumn1 = Convert.ToString(view.GetRowCellValue(e.RowHandle1, e.Column.FieldName));
                    string valueOtherColumn2 = Convert.ToString(view.GetRowCellValue(e.RowHandle2, e.Column.FieldName));
                    e.Merge   = valueFirstColumn1 == valueFirstColumn2 && valueOtherColumn1 == valueOtherColumn2;
                    e.Handled = true;
                }
                break;
                }
            }
            catch (Exception ex)
            {
                //ExceptionHandler.HandleException(this.Text + "--设置Grid单元格合并错误。", ex);
                ExceptionHandler.HandleException(this.Text + "--" + tsmiSzgrid.Text, ex);
            }
        }