zoukankan      html  css  js  c++  java
  • DevExpress中的GridView(GRIDCONTROL)中的右键全选、反选、撤销、复制单元格值ContextMenuStrip

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

    2018年11月22日 11:25:41 mQney 阅读数 177

    
     
    1. #region 标本接收的右键

    2. private void 全选ToolStripMenuItem_Click(object sender, EventArgs e)

    3. {

    4. if (this._dtT_LIS_SAMPLERECEIVE_REPORTS == null || this._dtT_LIS_SAMPLERECEIVE_REPORTS.Rows.Count < 1) { return; }

    5. foreach (DataRow drT_LIS_SAMPLERECEIVE_REPORTS in this._dtT_LIS_SAMPLERECEIVE_REPORTS.Rows)

    6. {

    7. drT_LIS_SAMPLERECEIVE_REPORTS[TableField.V_SEL] = EnumYesNo.YES.ToString("d");

    8. }

    9. }

    10. private void 反选ToolStripMenuItem_Click(object sender, EventArgs e)

    11. {

    12. if (this._dtT_LIS_SAMPLERECEIVE_REPORTS == null || this._dtT_LIS_SAMPLERECEIVE_REPORTS.Rows.Count < 1) { return; }

    13. foreach (DataRow drT_LIS_SAMPLERECEIVE_REPORTS in this._dtT_LIS_SAMPLERECEIVE_REPORTS.Rows)

    14. {

    15. int i = 0;

    16. string strValue = drT_LIS_SAMPLERECEIVE_REPORTS[TableField.V_SEL] == null ? "" : drT_LIS_SAMPLERECEIVE_REPORTS[TableField.V_SEL].ToString();

    17. int.TryParse(strValue, out i);

    18. drT_LIS_SAMPLERECEIVE_REPORTS[TableField.V_SEL] = i ^ 1;

    19. }

    20. }

    21. private void 全撤ToolStripMenuItem_Click(object sender, EventArgs e)

    22. {

    23. if (this._dtT_LIS_SAMPLERECEIVE_REPORTS == null || this._dtT_LIS_SAMPLERECEIVE_REPORTS.Rows.Count < 1) { return; }

    24. foreach (DataRow drT_LIS_SAMPLERECEIVE_REPORTS in this._dtT_LIS_SAMPLERECEIVE_REPORTS.Rows)

    25. {

    26. drT_LIS_SAMPLERECEIVE_REPORTS[TableField.V_SEL] = EnumYesNo.NO.ToString("d");

    27. }

    28. }

    29.  
    30. private void 复制病历号ToolStripMenuItem_Click(object sender, EventArgs e)

    31. {

    32. int rowHandle = this.gridView采样标本接收.FocusedRowHandle;

    33. if (rowHandle >= 0)

    34. {

    35. DataRow row = this.gridView采样标本接收.GetDataRow(rowHandle);

    36. try

    37. {

    38. Clipboard.SetText(row[TableField.T_LIS_SAMPLERECEIVE_REPORTS.MEDICALRECORDNO] == null ? "" : row[TableField.T_LIS_SAMPLERECEIVE_REPORTS.MEDICALRECORDNO].ToString());

    39. }

    40. catch (Exception)

    41. {

    42. //throw;

    43. }

    44. }

    45. }

    46.  
    47. private void 复制姓名ToolStripMenuItem_Click(object sender, EventArgs e)

    48. {

    49. int rowHandle = this.gridView采样标本接收.FocusedRowHandle;

    50. if (rowHandle >= 0)

    51. {

    52. DataRow row = this.gridView采样标本接收.GetDataRow(rowHandle);

    53. try

    54. {

    55. Clipboard.SetText(row[TableField.T_LIS_SAMPLERECEIVE_REPORTS.PNAME] == null ? "" : row[TableField.T_LIS_SAMPLERECEIVE_REPORTS.PNAME].ToString());

    56. }

    57. catch (Exception)

    58. {

    59. //throw;

    60. }

    61. }

    62. }

    63.  
    64. private void 复制条码号ToolStripMenuItem_Click(object sender, EventArgs e)

    65. {

    66. int rowHandle = this.gridView采样标本接收.FocusedRowHandle;

    67. if (rowHandle >= 0)

    68. {

    69. DataRow row = this.gridView采样标本接收.GetDataRow(rowHandle);

    70. try

    71. {

    72. Clipboard.SetText(row[TableField.T_LIS_SAMPLERECEIVE_REPORTS.REQUESTRECORDNO] == null ? "" : row[TableField.T_LIS_SAMPLERECEIVE_REPORTS.REQUESTRECORDNO].ToString());

    73. }

    74. catch (Exception)

    75. {

    76. //throw;

    77. }

    78. }

    79. }

    80. #endregion

  • 相关阅读:
    常量池 栈 堆
    函数的调用
    字符、数组
    整理
    JavaScript深入之——原型与原型链
    虚拟机(VMware)中文破解版,及创建虚拟机
    小程序之mpvue使用
    报错整理及解决办法
    js 关于时间方面的通用函数
    iview Cascader级联选择省市区问题
  • 原文地址:https://www.cnblogs.com/grj001/p/12225047.html
Copyright © 2011-2022 走看看