private void Data_Dgn_CellMouseUp(object sender, DataGridViewCellMouseEventArgs e) { if (e.ColumnIndex != 0 || e.RowIndex == -1) { if (e.RowIndex >= 0 && e.ColumnIndex >= 0) { try { this.GridSelectRowIndexChanged(e.RowIndex); } catch { } } return; //如果不是第一列,则退出 } try { this.GridSelectRowIndexChanged(e.RowIndex); } catch { } if (Data_WGJC[e.ColumnIndex, e.RowIndex].ReadOnly) { return; //如果是只读则退出! } if (ParentMain.Evt_OnYaoJianChanged != null) { bool Yn; if ((bool)Data_WGJC.Rows[e.RowIndex].Cells[e.ColumnIndex].Value) { Yn = false; Data_WGJC.EndEdit(); } else { Yn = true; Data_WGJC.EndEdit(); } Data_WGJC.Enabled = false; //Comm.Function.TopWaiting.ShowWaiting("正在更改..."); ParentMain.Evt_OnYaoJianChanged(_TaiType, _TaiID, e.RowIndex, Yn); //Comm.Function.TopWaiting.HideWaiting(); } else { MessageBoxEx.Show(this, "没有处理事件Evt_OnYaoJianChanged", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }