Exemplo n.º 1
0
        private void btn删除_Click(object sender, EventArgs e)
        {
            ColumnView colView = (ColumnView)gridControl1.MainView;

            if (colView != null)
            {
                if (MessageBox.Show("确实删除当前记录吗?", "删除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, 0, false) == DialogResult.Yes)
                {
                    OtherMoneyData currentItem = (OtherMoneyData)colView.GetFocusedRow();
                    currRows.Remove(currentItem);
                    OtherMoney.GetOtherMoney(currentItem.员工编号, currentItem.年, currentItem.月, currentItem.类型, currentItem.项目名称);
                    currentItem = null;
                    gridControl1.RefreshDataSource();
                    MessageBox.Show("删除成功。", "删除提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }