Ejemplo n.º 1
0
        private void DTUTrepositoryItemCalcEdit_EditValueChanged(object sender, EventArgs e)
        {
            GridView view = avdGridView;

            DevExpress.XtraEditors.CalcEdit edit = sender as DevExpress.XtraEditors.CalcEdit;

            decimal dTut = edit.Value;
            decimal aKur = view.GetFocusedRowCellValue(colAKUR) == DBNull.Value ? 0 : Convert.ToDecimal(view.GetFocusedRowCellValue(colAKUR));
            decimal aTut = Math.Round(dTut * aKur, 2);

            initRow = true;
            view.SetFocusedRowCellValue(colATUT, aTut);
            initRow = false;

            avdDtyGridView.UpdateCurrentRow();
            //avddGridView.UpdateSummary();
        }
Ejemplo n.º 2
0
        protected override void OnActiveEditor_ValueChanged(object sender, EventArgs e)
        {
            base.OnActiveEditor_ValueChanged(sender, e);
            System.Data.DataView _dv = (this.DataSource as System.Data.DataView);
            if (_dv != null && (_dv.AllowNew == false || _dv.AllowEdit == false) && this.FocusedRowHandle == -2147483647)
            {
                return;
            }
            if (string.Format("{0}", this.FocusedColumn.Tag).Equals("UnSetValue"))
            {
                return;
            }
            string _sType = sender.GetType().ToString();

            switch (_sType)
            {
            case "DevExpress.XtraEditors.LookUpEdit":
            case "ExtendControl.ExtRpyLookUpEdit":
            case "ExtendControl.SingLookUpEdit":
                if (
                    ((DevExpress.XtraEditors.LookUpEdit)(sender)).IsPopupOpen == false &&
                    ((DevExpress.XtraEditors.LookUpEdit)(sender)).EditValue != null)
                {
                    object _val = ((DevExpress.XtraEditors.LookUpEdit)(sender)).EditValue;
                    SetFocusedValue(_val);
                }
                break;

            case "DevExpress.XtraEditors.CheckEdit":
                if (
                    ((DevExpress.XtraEditors.CheckEdit)(sender)).EditValue != null)
                {
                    object _val = ((DevExpress.XtraEditors.CheckEdit)sender).EditValue;
                    SetFocusedValue(_val);
                }
                break;

            case "DevExpress.XtraEditors.CheckedComboBoxEdit":
            case "ExtendControl.ExtCheckedComboBoxEdit":
                if (
                    ((DevExpress.XtraEditors.CheckedComboBoxEdit)(sender)).IsPopupOpen == false &&
                    ((DevExpress.XtraEditors.CheckedComboBoxEdit)(sender)).EditValue != null)
                {
                    object _val = ((DevExpress.XtraEditors.CheckedComboBoxEdit)sender).EditValue;
                    SetFocusedValue(_val);
                }
                break;

            case "DevExpress.XtraEditors.ImageComboBoxEdit":
                DevExpress.XtraEditors.ImageComboBoxEdit _imgSender = sender as DevExpress.XtraEditors.ImageComboBoxEdit;
                if (_imgSender.IsPopupOpen == false && _imgSender.EditValue != null)
                {
                    SetFocusedValue(_imgSender.EditValue);
                }
                break;

            case "DevExpress.XtraEditors.CalcEdit":
                DevExpress.XtraEditors.CalcEdit _clacSender = sender as DevExpress.XtraEditors.CalcEdit;
                if (_clacSender != null && _clacSender.EditValue != null)
                {
                    object _val      = _clacSender.EditValue;
                    int    _selStart = _clacSender.SelectionStart;
                    SetFocusedValue((_val.Equals(string.Empty) || _val.Equals(".")) ? 0 : _val);
                    _clacSender.SelectionStart = _selStart;
                }
                break;

            case "DevExpress.XtraEditors.TextEdit":
                if (((DevExpress.XtraEditors.TextEdit)(sender)).EditValue != null)
                {
                    object _val = ((DevExpress.XtraEditors.TextEdit)(sender)).EditValue;
                    SetFocusedValue(_val);
                }
                break;
            }
        }