DevExpress中的GridView(GRIDCONTROL)中的右键全选、反选、撤销、复制单元格值ContextMenuStrip

        #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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值