oSuiFengPiaoDang12
oSuiFengPiaoDang12
2017-09-24 03:25

DEVGridControl控件使用问题

  • gridcontrol
  • dev
  • gridview

图片说明
图片说明
焦点失去后,显示的值没有小数点了,代码如下,请问,为什么不能显示小数点后几位的值。

         /// <summary>
        /// 统一设置SpinEdit格式
        /// </summary>
        /// <param name="GridCol">需要设置的控件</param>
        /// <param name="status">类型,参数:0,不带小数;参数1:带1位小数;……;参数5,带5位小数</param>
        /// <param name="EncryptedText">是否使用'*'代替显示数值</param>
        /// <param name="ShowButton">是否清除控件上的增加,减少按钮</param>
        public static void BaseFormat(GridColumn GridCol, int status, bool EncryptedText, bool ShowButton)
        {
            RepositoryItemSpinEdit _SpinEdit = new RepositoryItemSpinEdit();
            string M_RegEx = string.Empty;
            switch (status)
            {
                case 0:
                    M_RegEx = "f0";
                    break;
                case 1:
                    M_RegEx = "f1";
                    break;
                case 2:
                    M_RegEx = "f2";
                    break;
                case 3:
                    M_RegEx = "f3";
                    break;
                case 4:
                    M_RegEx = "f4";
                    break;
                case 5:
                    M_RegEx = "f5";
                    break;
            }
            _SpinEdit.Mask.EditMask = M_RegEx;
            _SpinEdit.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            _SpinEdit.DisplayFormat.FormatString = M_RegEx;
            _SpinEdit.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            _SpinEdit.EditFormat.FormatString = M_RegEx;
            if (EncryptedText)
            {
                _SpinEdit.PasswordChar = '*';
            }
            if (ShowButton)
            {
                _SpinEdit.Buttons.Clear();
            }
            GridCol.ColumnEdit = _SpinEdit;
        }
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答