private void InitDataGridView() { DataTable dt = ReceiptModalDAO.GetDatas(); InitFuncs initFuncs = new InitFuncs(); initFuncs.InitDataGridView(this.dataGridViewRecMod, dt); this.dataGridViewRecMod.ClearSelection(); this.dataGridViewRecMod.Rows[this.curRowIndex].Selected = true; }
private void toolStripButtonDelete_Click(object sender, EventArgs e) { if (this.dataGridViewRecMod.SelectedRows.Count <= 0) { return; } if (this.dataGridViewRecMod.SelectedRows[0].Cells["单据模板编号"].Value == null) { return; } string receTypeID = this.dataGridViewRecMod.SelectedRows[0].Cells["单据模板编号"].Value.ToString().Trim(); if (MessageBox.Show("确定要删除吗?", "提示信息", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.OK) { ReceiptModalDAO.DeleteByReceTypeID(receTypeID); InitDataGridView(); } }