private void gvDetail_CustomRowCellEditForEditing(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            int projectId = (int)gvPO.GetFocusedDataRow()[colProjectCode.FieldName];

            DataRow row = gvDetail.GetDataRow(e.RowHandle);

            if (e.Column == colDetailLevel1Code)
            {
                var codeList = LevelOneCode.ListForProject(projectId).Select(code => new { MatchId = code.MatchId, Code = code.Code, Desc = code.Desc, DisplayName = code.DisplayName }).Distinct().ToList();
                luDetailLevel.DataSource = codeList.OrderBy(x => x.MatchId);
                e.RepositoryItem         = luDetailLevel;
            }
            else if (e.Column == colDetailLevel2Code)
            {
                int level1Id = row[colDetailLevel1Code.FieldName] == DBNull.Value ? -1 : (int)row[colDetailLevel1Code.FieldName];
                var codeList = LevelTwoCode.SubList(level1Id, projectId).Select(code => new { MatchId = code.MatchId, Code = code.Code, Desc = code.Desc, DisplayName = code.DisplayName }).Distinct().ToList();
                luDetailLevel.DataSource = codeList.OrderBy(x => x.MatchId);
                e.RepositoryItem         = luDetailLevel;
            }
            else if (e.Column == colDetailLevel3Code)
            {
                int level2Id = row[colDetailLevel2Code.FieldName] == DBNull.Value ? -1 : (int)row[colDetailLevel2Code.FieldName];
                var codeList = LevelThreeCode.SubList(level2Id, projectId).Select(code => new { MatchId = code.MatchId, Code = code.Code, Desc = code.Desc, DisplayName = code.DisplayName }).Distinct().ToList();
                luDetailLevel.DataSource = codeList.OrderBy(x => x.MatchId);
                e.RepositoryItem         = luDetailLevel;
            }
            else if (e.Column == colDetailLevel4Code)
            {
                int level3Id = row[colDetailLevel3Code.FieldName] == DBNull.Value ? -1 : (int)row[colDetailLevel3Code.FieldName];
                var codeList = LevelFourCode.SubList(level3Id, projectId).Select(code => new { MatchId = code.MatchId, Code = code.Code, Desc = code.Desc, DisplayName = code.DisplayName }).Distinct().ToList();
                luDetailLevel.DataSource = codeList.OrderBy(x => x.MatchId);
                e.RepositoryItem         = luDetailLevel;
            }
        }
Exemple #2
0
        private void LinesView_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            try
            {
                if (LinesView.IsFilterRow(e.RowHandle))
                {
                    e.RepositoryItem = new RepositoryItemTextEdit();
                }
                else
                {
                    if (e.RowHandle >= 0 && e.Column.AbsoluteIndex == 3)
                    {
                        int  PCode;
                        bool IsParsed = int.TryParse(LinesView.GetRowCellValue(e.RowHandle, LinesView.Columns[1]).ToString(), out PCode);

                        if (IsParsed == true)
                        {
                            FillWareHouse(PCode, e.RowHandle);
                            RepositoryItemSearchLookUpEdit re = (RepositoryItemSearchLookUpEdit)repWareHouse.Clone();
                            e.RepositoryItem = re;
                        }
                        else
                        {
                            // MessageBox.Show("You Must Choose Product Firstly", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 void gridView1_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
 {
     if (e.Column.FieldName == "LargeImage")
     {
         e.RepositoryItem = new DevExpress.XtraEditors.Repository.RepositoryItemPictureEdit();
     }
 }
Exemple #4
0
        private void grvUCList_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            GridView gv = sender as GridView;

            if (e.Column.FieldName == "GiaTri")
            {
                if (gv.GetRowCellValue(e.RowHandle, gv.Columns["LoaiDLChamCong!"]) != null)
                {
                    var          l   = gv.GetRowCellValue(e.RowHandle, grvUCList.Columns["LoaiDLChamCong!"]);
                    XPCollection xpc = new XPCollection(xpcLoaiDLChamCong, CriteriaOperator.Parse("KieuDuLieu = ?", (l as LoaiDuLieuChamCong).KieuDuLieu));
                    if (xpc.Count > 0)
                    {
                        switch ((xpc[0] as LoaiDuLieuChamCong).KieuDuLieu)
                        {
                        case "Int":
                            e.RepositoryItem = spinEdit;
                            break;

                        case "DateTime":
                            e.RepositoryItem = repositoryItemTimeEdit1;
                            break;

                        case "String":
                            e.RepositoryItem = textEdit;
                            break;
                        }
                    }
                }
            }
        }
        void gvTransitions_CustomRowCellEditForEditing(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            var value = gvTransitions.GetRowCellValue(e.RowHandle, e.Column);

            if (value != DBNull.Value)
            {
                switch (e.Column.Name)
                {
                case "DestinationState":
                    e.RepositoryItem = DestStateRepositoryItem;
                    break;

                case "Output":
                    e.RepositoryItem = OutputRepositoryItem;
                    break;

                case "Probability":
                    e.RepositoryItem = ProbabilityRepositoryItem;
                    break;
                }
            }
            else
            {
                e.RepositoryItem = EmptyCellRepositoryItem;
            }
            foreach (var button in (e.RepositoryItem as RepositoryItemButtonEdit).Buttons)
            {
                if (button is GridEditorButton)
                {
                    (button as GridEditorButton).SetCell(e.RowHandle, e.Column);
                }
            }
        }
Exemple #6
0
        void _AdvBandGridView_CustomRowCellEditForEditing(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            if (_HViewConvertObject == null || _DynamicBandColumns == null || _DynamicBandColumns.Count == 0)
            {
                return;
            }
            // if (!_HViewConvertObject.ConvertCfgParam.DynamicColumnCaption) return;

            if (e.Column.FieldName.IndexOf(DYNAMIC_COL_LEFT_NAME) >= 0)
            {
                if (_ReadOnly)
                {
                    e.RepositoryItem.ReadOnly     = true;
                    e.RepositoryItem.AllowFocused = false;
                }
                else
                {
                    bool canEdit = checCanEdit(e.RowHandle, e.Column.FieldName);
                    e.RepositoryItem.ReadOnly     = !canEdit;
                    e.RepositoryItem.AllowFocused = canEdit;
                    e.RepositoryItem.AppearanceReadOnly.BackColor   = canEdit ? Color.White : Color.WhiteSmoke;
                    e.RepositoryItem.AppearanceReadOnly.BorderColor = canEdit ? Color.White : Color.WhiteSmoke;
                    if (!canEdit)
                    {
                        SendKeys.Send("{TAB}");
                    }
                }
            }
        }
Exemple #7
0
        private void grvUCList_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            GridView gv = sender as GridView;

            if (e.Column.FieldName == "DuLieuMacDinh")
            {
                if (gv.GetRowCellValue(e.RowHandle, gv.Columns["KieuDuLieu"]) != null)
                {
                    var l = gv.GetRowCellValue(e.RowHandle, grvUCList.Columns["KieuDuLieu"]);
                    switch (l.ToString())
                    {
                    case "Int":
                        e.RepositoryItem = spinEdit;
                        break;

                    case "DateTime":
                        e.RepositoryItem = repositoryItemTimeEdit1;
                        break;

                    case "String":
                        e.RepositoryItem = textEdit;
                        break;
                    }
                }
            }
        }
Exemple #8
0
        private void GridView1_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            if (e.Column != this.colSparkline)
            {
                return;
            }
            Ticker t = (Ticker)this.gvTikers.GetRow(e.RowHandle);

            if (this.greenSparkline == null)
            {
                this.greenSparkline            = (RepositoryItemSparklineEdit)e.RepositoryItem.Clone();
                this.greenSparkline.View.Color = Exchange.BidColor;
                this.gcTickers.RepositoryItems.Add(this.greenSparkline);
            }
            if (this.redSparkline == null)
            {
                this.redSparkline            = (RepositoryItemSparklineEdit)e.RepositoryItem.Clone();
                this.redSparkline.View.Color = Exchange.AskColor;
                this.gcTickers.RepositoryItems.Add(this.redSparkline);
            }
            if (t.Sparkline.Length < 2)
            {
                return;
            }
            if (t.Sparkline[t.Sparkline.Length - 1] > t.Sparkline[0])
            {
                e.RepositoryItem = this.greenSparkline;
            }
            else
            {
                e.RepositoryItem = this.redSparkline;
            }
        }
 private void oppGridView_CustomRowCellEditForEditing(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
 {
     // Editor for Editing Only, colOPCIDp.ColumnEdit is null
     if (e.Column == colOPCIDp)
     {
         e.RepositoryItem = OPCLUPrepositoryItemLookUpEdit;
     }
 }
Exemple #10
0
 private void RowGridBandedView_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
 {
     if (e.RowHandle == GridControl.NewItemRowHandle &&             // avoid "No image data" text in new item row
         e.RepositoryItem is RepositoryItemPictureEdit)
     {
         e.RepositoryItem = new RepositoryItemTextEdit();
     }
 }
Exemple #11
0
 //自定义的表格行编辑
 private void gridView1_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
 {
     if (e.Column.FieldName == "dep_id")
     {
         e.RepositoryItem = repositoryItemLookUpEdit1;    //编辑室选择下拉框
         //通过自定义行表格编辑事件可表格的操作多样化。
     }
 }
Exemple #12
0
        private void gridView1_CustomRowCellEditForEditing(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            DataRow tempRow = gridView1.GetFocusedDataRow();

            if (e.Column.FieldName.Equals("CODE") && tempRow != null && tempRow["AUTHORID"] != DBNull.Value)
            {
                FocusedAuthorid = Convert.ToDecimal(tempRow["AUTHORID"]);
            }
        }
Exemple #13
0
        private void advBandedGridView1_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            GridView view = sender as GridView;

            if (e.Column.FieldName == "COUP_RES" && view.IsFilterRow(e.RowHandle))
            {
                e.RepositoryItem = repositoryItemPopupContainerEdit1;
            }
        }
Exemple #14
0
 /// <summary>
 ///单元格修改触发事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gridView1_CustomRowCellEditForEditing(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
 {
     //if (e.Column.FieldName == "OUT_QTY_2")
     //{
     //    double used = Convert.ToDouble(e.CellValue);                                             //耗用数量
     //    double lailiao = Convert.ToDouble(gridView1.GetRowCellValue(e.RowHandle, "IN_QTY_1"));   //来料数量
     //    double tuiliao = Convert.ToDouble(gridView1.GetRowCellValue(e.RowHandle, "OUT_QTY_1")); //退料数量
     //    double first = Convert.ToDouble(gridView1.GetRowCellValue(e.RowHandle, "INIT_QTY"));     //期初数量
     //    gridView1.SetRowCellValue(e.RowHandle, "END_QTY", lailiao + first - used - tuiliao);     //计算期末数量在单元格内数据发生变更时
     //}
 }
 private void gvwView1_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
 {
     try
     {
         //if (gvwView1.GetRowCellValue(e.RowHandle, gvwView1.Columns["MR2_FILE"]).ToString().Equals(""))
         //{
         //    this.repositoryItemTextEditReadOnly.ReadOnly = true;
         //    e.RepositoryItem = repositoryItemTextEditReadOnly;
         //}
     }
     catch { }
 }
Exemple #16
0
        private void gridView2_CustomRowCellEditForEditing(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            txtMCTHDX.Text    = gridView2.GetRowCellValue(e.RowHandle, "MaCTHoaDonXuat").ToString();
            txtGB.Text        = gridView2.GetRowCellValue(e.RowHandle, "GiaBan").ToString();
            txtMSP.Text       = gridView2.GetRowCellValue(e.RowHandle, "MaSP").ToString();
            txtSL.Text        = gridView2.GetRowCellValue(e.RowHandle, "SoLuong").ToString();
            txtThanhTien.Text = gridView2.GetRowCellValue(e.RowHandle, "ThanhTien").ToString();

            HamThanhTienB();

            HamThanhTienC();
        }
Exemple #17
0
        private void gvUsers_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            if (e.Column.FieldName == "EMPLOYEE")
            {
                return;
            }
            int rowHandle = e.RowHandle + 1;

            if (buttons.ContainsKey(rowHandle))
            {
                e.RepositoryItem = buttons[rowHandle];
            }
        }
Exemple #18
0
 private void gridView1_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
 {
     //if (_isCanEdit)
     //{
     if (e.RowHandle == 0 && 0 < e.Column.ColumnHandle && e.Column.ColumnHandle < gridView1.Columns.Count - 1)
     {
         e.RepositoryItem = _reSize;
     }
     if ((e.RowHandle > 0 && e.RowHandle < gridView1.RowCount - 1) && (e.Column.ColumnHandle == 0))
     {
         e.RepositoryItem = _reSizePart;    // _reColor;
     }
     //}
 }
        private void gridView14_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            //GridView view = (GridView)sender;
            //if (e.Column.FieldName == "Item")
            //{
            //    RepositoryItemCheckEdit check = new RepositoryItemCheckEdit();
            //    string clickedJobName = view.GetRowCellValue(e.RowHandle, view.Columns["Item"]).ToString();
            //    check.Name = clickedJobName;
            //    e.RepositoryItem = check;
            //    check.AllowGrayed = true;

            //    e.Column.ColumnEdit = check;

            //}
        }
 private void gridView1_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
 {
     if (e.Column.Name == "colExpand" && e.RowHandle >= 0)
     {
         GridView gv   = sender as GridView;
         var      item = (DataItemViewModelBase)gv.GetRow(e.RowHandle);
         if (item.Show)
         {
             e.RepositoryItem = this.btnShrinkRow;
         }
         else
         {
             e.RepositoryItem = this.btnExpandRow;
         }
     }
 }
Exemple #21
0
 private void gridView_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
 {
     try
     {
         if (e.Column.FieldName == m_ProgressField)
         {
             int RecQty = SysConvert.ToInt32(m_GridView.GetRowCellValue(e.RowHandle, m_ProgressField));
             int Qty    = SysConvert.ToInt32(m_GridView.GetRowCellValue(e.RowHandle, m_MaxinumField));
             ProgressBar.Maximum = Qty;
         }
     }
     catch (Exception E)
     {
         MessageBox.Show(E.Message, "异常");
     }
 }
Exemple #22
0
 private void gridViewData_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
 {
     for (int i = 0; i < gridViewData.RowCount; i++)
     {
         DataRowView row = gridViewData.GetRow(i) as DataRowView;
         if (row != null)
         {
             if (e.Column.FieldName == "colImage")
             {
                 if (e.RowHandle == i)
                 {
                     e.RepositoryItem = showImage;
                 }
             }
         }
     }
 }
Exemple #23
0
        void gridViewWMeterInRoom_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            //if (e.RowHandle < 0)
            //    return;

            //if (!e.Column.FieldName.Equals("wpresent_energy_value"))
            //    return;

            //if (e.Column.FieldName == "wpresent_energy_value")
            //{
            //    if (gridViewWMeterInRoom.FocusedRowHandle < 0) return;

            //    int meterID = gridViewWMeterInRoom.GetRowCellValue(gridViewWMeterInRoom.FocusedRowHandle, "water_id").To<int>();

            //    DataTable DTLook = new DataTable();

            //    DTLook.Columns.Add("DateLastest", typeof(DateTime));
            //    DTLook.Columns.Add("TotalUnit", typeof(double));

            //    DataTable LastestDT = new DataTable();

            //    LastestDT = BusinessLogicBridge.DataStore.getLastestWaterDropDown(meterID);
            //    repositoryItemComboBoxLastestDate1.Items.Clear();
            //    for (int j = 0; j < LastestDT.Rows.Count; j++)
            //    {

            //        DTLook.Rows.Add(LastestDT.Rows[j]["DateLastest"], LastestDT.Rows[j]["TotalUnit"].To<double>());

            //        repositoryItemComboBoxLastestDate1.Items.Add(LastestDT.Rows[j]["DateLastest"] + " " + LastestDT.Rows[j]["TotalUnit"].ToString());

            //    }

            //    e.RepositoryItem = repositoryItemComboBoxLastestDate1;

            //    //string[] formatStringCheck = gridViewWMeterInRoom.GetRowCellValue(e.RowHandle, "wpresent_energy_value").ToString().Split(' ');

            //    //if (formatStringCheck.Length > 1)
            //    //{
            //    //    // Yes
            //    //    // date and value
            //    //    gridViewWMeterInRoom.SetRowCellValue(e.RowHandle, "wpresent_date_update", formatStringCheck[0].ToString());
            //    //    gridViewWMeterInRoom.SetRowCellValue(e.RowHandle, "wpresent_energy_value", formatStringCheck[1].To<double>());
            //    //}

            //}
        }
Exemple #24
0
        private void gridView1_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            //if (e.Column.FieldName == "Monitor")


            //GridView gv = sender as GridView;
            //gv.SetFocusedRowModified();
            //string fieldName = gv.GetFocusedRowCellValue("Monitor").ToString();

            //if (fieldName == "True")
            //{
            //    ((RepositoryItemButtonEdit)gv.Columns["Monitor"].ColumnEdit).Buttons[0].Enabled = false;
            //}
            //else
            //{
            //    ((RepositoryItemButtonEdit)gv.Columns["Monitor"].ColumnEdit).Buttons[0].Enabled = true;
            //}
        }
Exemple #25
0
        private void gridView1_CustomRowCellEditForEditing(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            if (e.RowHandle >= 0)
            {
                gridControl2.DataSource = cthdxbus.DanhSachChiTietHoaDonXuat(gridView1.GetRowCellValue(e.RowHandle, "MaHDX").ToString());
                txtMHDX.Text            = gridView1.GetRowCellValue(e.RowHandle, "MaHDX").ToString();
                txtMKH.Text             = gridView1.GetRowCellValue(e.RowHandle, "MaKH").ToString();
                txtMNV.Text             = gridView1.GetRowCellValue(e.RowHandle, "MaNV").ToString();
                txtTT.Text = gridView1.GetRowCellValue(e.RowHandle, "TongTien").ToString();

                txtMCTHDX.Text = gridView1.GetRowCellValue(e.RowHandle, "MaHDX").ToString();

                HamThanhTienA();

                txtThanhTien.Text = "";
                txtSL.Text        = "";
                txtMSP.Text       = "";
                txtGB.Text        = "";
                bthIHD.Enabled    = true;
            }
        }
Exemple #26
0
        private void GridCustomRowCellEditForEditing(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            if (e.Column.FieldName == nameof(invoices_details.itemunit_id))
            {
                RepositoryItemLookUpEdit repo = new RepositoryItemLookUpEdit();
                repo.NullText    = "";
                e.RepositoryItem = repo;
                var ins = new Session.ProductViewClass.ProductUOMView();
                var row = Grid.GetRow(e.RowHandle) as invoices_details;
                if (row == null)
                {
                    return;
                }
                var item = Session.ProductView.SingleOrDefault(x => x.id == row.itemid);
                if (item == null)
                {
                    return;
                }

                repo.DataSource    = item.Units;
                repo.ValueMember   = nameof(ins.unitid);
                repo.DisplayMember = nameof(ins.UnitName);

                repo.ForceInitialize();
                repo.PopulateColumns();

                repo.BestFitMode          = BestFitMode.BestFitResizePopup;
                repo.HighlightedItemStyle = DevExpress.XtraEditors.HighlightStyle.Standard;
                repo.Columns[nameof(ins.unitid)].Visible    = false;
                repo.Columns[nameof(ins.UnitName)].Caption  = "إسم الوحدة";
                repo.Columns[nameof(ins.factor)].Caption    = "معالج التحويل";
                repo.Columns[nameof(ins.buyprice)].Caption  = "سعر الشراء";
                repo.Columns[nameof(ins.sellprice)].Caption = "سعر البيع";
                repo.Columns[nameof(ins.barcode)].Caption   = "الباركود";
            }
            else if (e.Column.FieldName == nameof(details.itemid))
            {
                e.RepositoryItem = repoItems;
            }
        }
        private void gvHRPlann_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            //if (Convert.ToString(e.Column) == "Plan Night")
            //{
            //    //    if(e.RowHandle (
            //    //foreach (DataRow ds in dsHRPlanning.HR_GetStdAndNorm.Rows)
            //    //{
            //    //    if (ds["OrgUnitNight"].ToString() == null)
            //    //    {
            //    //        colPlanNigth.OptionsColumn.AllowEdit = false;
            //    //        colPlanNigth.OptionsColumn.ReadOnly = true;
            //    //    }
            //    //}

            //string abc =Convert .ToString ( gvHRPlann.GetRowCellValue(gvHRPlann .FocusedRowHandle , "OrgUnitNight"));
            // dsHRPlanning.PrePlanning.Rows[e.ListSourceRowIndex]["DrillRigValid"].ToString();
            //    if(abc =="")
            //    {
            //        e.Column.OptionsColumn.AllowEdit = false;
            //        e.Column.OptionsColumn.ReadOnly = true;
            //    }
            //}
        }
Exemple #28
0
 private void View_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
 {
     if (e.Column == Column)
     {
         int percent = Convert.ToInt16(e.CellValue);
         if (percent > 72)
         {
             e.RepositoryItem = prbLess72;
         }
         else if (percent > 70)
         {
             e.RepositoryItem = prbLess70;
         }
         else if (percent > 68)
         {
             e.RepositoryItem = prbLess68;
         }
         else if (percent > 0)
         {
             e.RepositoryItem = prbLess0;
         }
     }
 }
Exemple #29
0
 private void View_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
 {
     if (e.Column == Column)
     {
         int percent = Convert.ToInt16(e.CellValue);
         if (percent < 25)
         {
             e.RepositoryItem = prbLess25;
         }
         else if (percent < 50)
         {
             e.RepositoryItem = prbLess50;
         }
         else if (percent < 75)
         {
             e.RepositoryItem = prbLess75;
         }
         else if (percent <= 100)
         {
             e.RepositoryItem = prbLess100;
         }
     }
 }
        private void grvArea_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
        {
            if (e.Column == gcUpperArea)
            {
                AreaDto areaDto = grvArea.GetRow(e.RowHandle) as AreaDto;
                RepositoryItemComboBox cboUpperArea = new RepositoryItemComboBox();

                if (areaDto.AreaTypeCode == "02")//如果是销售小区
                {
                    CommonHandler.BindComboBoxItems <AreaDto>(cboUpperArea, saleAreaList, "AreaName", "AreaCode");
                    e.RepositoryItem = cboUpperArea;
                }
                else if (areaDto.AreaTypeCode == "04")//如果是售后小区
                {
                    CommonHandler.BindComboBoxItems <AreaDto>(cboUpperArea, serverAreaList, "AreaName", "AreaCode");
                    e.RepositoryItem = cboUpperArea;
                }
                else
                {
                    cboUpperArea.ReadOnly = true;
                    e.RepositoryItem      = cboUpperArea;
                }
            }
        }