Exemplo n.º 1
0
        /// <summary>
        /// 选择行
        /// </summary>
        /// <param name="isTab"></param>
        private void SelectedRow(bool isTab)
        {
            BaseDataContract dr = (isTrigger ? CurrentDataContract : CurrentData());

            if (dr == null)
            {
                return;
            }
            if (string.IsNullOrEmpty(Properties.ValueColumn))
            {
                DialogBox.Msg("请指定数据列-ValueColumn.", MessageBoxIcon.Exclamation);
                return;
            }
            if (string.IsNullOrEmpty(Properties.DisplayColumn))
            {
                DialogBox.Msg("请指定显示列-DisplayColumn.", MessageBoxIcon.Exclamation);
                return;
            }
            ValueChanged            = true;
            CellValueChanged        = true;
            Properties.DBValue      = EntityTools.GetFieldValue(dr, Properties.ValueColumn).ToString();
            Properties.DBRow        = dr;
            Properties.DisplayValue = EntityTools.GetFieldValue(dr, Properties.DisplayColumn).ToString();
            this.Text = Properties.DisplayValue;
            Properties.DBValueChanged(this);
            this.DBValueChanged(this);
            this.SelectionStart = this.Text.Length;
            ClosePopup();
            TextChanged  = false;
            ValueChanged = false;

            if (isTab)
            {
                MoveNextControl();
            }
            if (this.IsExistsGroup)
            {
                ExpandRows();
            }
            this.Focus();
        }