private void btnAddNewFile_Click(object sender, EventArgs e) { IList <XModelBase> gridList = this.grdFiles.DataSource as IList <XModelBase>; frmTaskAttachmentEdit frm = new frmTaskAttachmentEdit(gridList); if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.grdFiles.DataSource = null; this.grdFiles.DataSource = frm.ModelList; this.grdFiles.Refresh(); } }
private void btnEditFile_Click(object sender, EventArgs e) { if (this.grdFiles.CurrentRow == null || this.grdFiles.CurrentRow.RowType != Janus.Windows.GridEX.RowType.Record) { XMessageBox.ShowError("请选择要编辑的记录!"); return; } XModelBase currentModel = this.grdFiles.CurrentRow.DataRow as XModelBase; frmTaskAttachmentEdit frm = new frmTaskAttachmentEdit(currentModel); if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.grdFiles.Refresh(); } }