DevExpress中的GridView(GRIDCONTROL)中的右键全选、反选、撤销、复制单元格值ContextMenuStrip
2018年11月22日 11:25:41 mQney 阅读数 177
-
#region 标本接收的右键 -
private void 全选ToolStripMenuItem_Click(object sender, EventArgs e) -
{ -
if (this._dtT_LIS_SAMPLERECEIVE_REPORTS == null || this._dtT_LIS_SAMPLERECEIVE_REPORTS.Rows.Count < 1) { return; } -
foreach (DataRow drT_LIS_SAMPLERECEIVE_REPORTS in this._dtT_LIS_SAMPLERECEIVE_REPORTS.Rows) -
{ -
drT_LIS_SAMPLERECEIVE_REPORTS[TableField.V_SEL] = EnumYesNo.YES.ToString("d"); -
} -
} -
private void 反选ToolStripMenuItem_Click(object sender, EventArgs e) -
{ -
if (this._dtT_LIS_SAMPLERECEIVE_REPORTS == null || this._dtT_LIS_SAMPLERECEIVE_REPORTS.Rows.Count < 1) { return; } -
foreach (DataRow drT_LIS_SAMPLERECEIVE_REPORTS in this._dtT_LIS_SAMPLERECEIVE_REPORTS.Rows) -
{ -
int i = 0; -
string strValue = drT_LIS_SAMPLERECEIVE_REPORTS[TableField.V_SEL] == null ? "" : drT_LIS_SAMPLERECEIVE_REPORTS[TableField.V_SEL].ToString(); -
int.TryParse(strValue, out i); -
drT_LIS_SAMPLERECEIVE_REPORTS[TableField.V_SEL] = i ^ 1; -
} -
} -
private void 全撤ToolStripMenuItem_Click(object sender, EventArgs e) -
{ -
if (this._dtT_LIS_SAMPLERECEIVE_REPORTS == null || this._dtT_LIS_SAMPLERECEIVE_REPORTS.Rows.Count < 1) { return; } -
foreach (DataRow drT_LIS_SAMPLERECEIVE_REPORTS in this._dtT_LIS_SAMPLERECEIVE_REPORTS.Rows) -
{ -
drT_LIS_SAMPLERECEIVE_REPORTS[TableField.V_SEL] = EnumYesNo.NO.ToString("d"); -
} -
} -
private void 复制病历号ToolStripMenuItem_Click(object sender, EventArgs e) -
{ -
int rowHandle = this.gridView采样标本接收.FocusedRowHandle; -
if (rowHandle >= 0) -
{ -
DataRow row = this.gridView采样标本接收.GetDataRow(rowHandle); -
try -
{ -
Clipboard.SetText(row[TableField.T_LIS_SAMPLERECEIVE_REPORTS.MEDICALRECORDNO] == null ? "" : row[TableField.T_LIS_SAMPLERECEIVE_REPORTS.MEDICALRECORDNO].ToString()); -
} -
catch (Exception) -
{ -
//throw; -
} -
} -
} -
private void 复制姓名ToolStripMenuItem_Click(object sender, EventArgs e) -
{ -
int rowHandle = this.gridView采样标本接收.FocusedRowHandle; -
if (rowHandle >= 0) -
{ -
DataRow row = this.gridView采样标本接收.GetDataRow(rowHandle); -
try -
{ -
Clipboard.SetText(row[TableField.T_LIS_SAMPLERECEIVE_REPORTS.PNAME] == null ? "" : row[TableField.T_LIS_SAMPLERECEIVE_REPORTS.PNAME].ToString()); -
} -
catch (Exception) -
{ -
//throw; -
} -
} -
} -
private void 复制条码号ToolStripMenuItem_Click(object sender, EventArgs e) -
{ -
int rowHandle = this.gridView采样标本接收.FocusedRowHandle; -
if (rowHandle >= 0) -
{ -
DataRow row = this.gridView采样标本接收.GetDataRow(rowHandle); -
try -
{ -
Clipboard.SetText(row[TableField.T_LIS_SAMPLERECEIVE_REPORTS.REQUESTRECORDNO] == null ? "" : row[TableField.T_LIS_SAMPLERECEIVE_REPORTS.REQUESTRECORDNO].ToString()); -
} -
catch (Exception) -
{ -
//throw; -
} -
} -
} -
#endregion