Exemplo n.º 1
0
        /// <summary>
        /// 删行事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void btnDelRow_Click(object sender, EventArgs e)
        {
            try
            {
                if (HTFormStatus == FormStatus.新增 || HTFormStatus == FormStatus.修改)
                {
                    if (DialogResult.Yes != this.ShowConfirmMessage("确实要删除该行"))
                    {
                        return;
                    }

                    if (HTDataDts.GridControl.DataSource != null)
                    {
                        this.BaseFocusLabel.Focus();
                        WCommon.DelDtRow((DataTable)HTDataDts.GridControl.DataSource, HTDataDts.FocusedRowHandle);
                    }
                }
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 删行
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cMenuItemDelRow_Click(object sender, EventArgs e)
        {
            try
            {
                if (_ToolForm.HTFormStatus == FormStatus.查询)
                {
                    MessageBox.Show("编辑状态下才可删行");
                    return;
                }

                if (_Grid.GridControl.DataSource != null)
                {
                    if (DialogResult.Yes != _ToolForm.ShowConfirmMessage("确实要删除该行"))
                    {
                        return;
                    }
                    WCommon.DelDtRow((DataTable)_Grid.GridControl.DataSource, _Grid.FocusedRowHandle);
                }
            }
            catch (Exception E)
            {
                MessageBox.Show(E.Message);
            }
        }