private void gridView1_DoubleClick(object sender, EventArgs e) { GridView view = (GridView)sender; GridHitInfo hitInfo = view.CalcHitInfo(view.GridControl.PointToClient(Control.MousePosition)); FormCollection fc = Application.OpenForms; if (hitInfo.HitTest == GridHitTest.RowCell) { if ((hitInfo.Column != null) && (hitInfo.Column == colVOUCHER_ID)) { string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colVOUCHERID); string strVOUCHERID = "[VOUCHERID] = \'" + strTemp + "\'"; if (fc["FrmCarryoverCostVoucherDetail"] != null) { fc["FrmCarryoverCostVoucherDetail"].Close(); } FrmCarryoverCostVoucherDetail FrmCCVD = new FrmCarryoverCostVoucherDetail(strVOUCHERID); FrmCCVD.Show(); FrmCCVD.Activate(); } } }
private void btnDetailQuery_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (selection.SelectedCount == 0) { //const string message = "没有勾选主单进行的详单查询时间会比较久(3分钟左右),继续么?"; //const string caption = "详单查询?"; //var result = MessageBox.Show(message, caption, // MessageBoxButtons.YesNo, // MessageBoxIcon.Question); //if (result == DialogResult.Yes) //{ FrmCarryoverCostVoucherDetail FrmCCVD = new FrmCarryoverCostVoucherDetail(); FrmCCVD.Show(); FrmCCVD.Activate(); //} } else { string strVOUCHERID = null; for (int i = 0; i < selection.SelectedCount; ++i) { int RowIndex = selection.GetSelectedRowIndex(i); int RowHandle = gridView1.GetRowHandle(RowIndex); string strTemp = gridView1.GetRowCellDisplayText(RowHandle, colVOUCHERID); strVOUCHERID += "[VOUCHERID] = \'" + strTemp + "\' Or "; } int index = strVOUCHERID.LastIndexOf("'"); strVOUCHERID = strVOUCHERID.Substring(0, index + 1).Trim(); FrmCarryoverCostVoucherDetail FrmCCVD = new FrmCarryoverCostVoucherDetail(strVOUCHERID); FrmCCVD.Show(); FrmCCVD.Activate(); } }