private void btnAdd_Click(object sender, EventArgs e) { DlvProfileAddEditDialog dlv = new DlvProfileAddEditDialog(this); if (dlv.ShowDialog() == DialogResult.OK) { this.dlvprofile = this.LoadDlvProfileFromServer(); this.bs.ResetBindings(true); this.bs.DataSource = this.dlvprofile; } }
private void btnEdit_Click(object sender, EventArgs e) { if (this.gridViewDlvProfile.GetRow(this.gridViewDlvProfile.FocusedRowHandle) == null) { return; } DlvProfileVM dlvprofile = this.dlvprofile.Where(d => d.Id == (int)this.gridViewDlvProfile.GetRowCellValue(this.gridViewDlvProfile.FocusedRowHandle, this.colProfileId)).FirstOrDefault(); if (dlvprofile == null) { return; } DlvProfileAddEditDialog dlv = new DlvProfileAddEditDialog(this, dlvprofile); if (dlv.ShowDialog() == DialogResult.OK) { this.dlvprofile = this.LoadDlvProfileFromServer(); this.bs.ResetBindings(true); this.bs.DataSource = this.dlvprofile; } }