private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            FormCollection fc = Application.OpenForms;

            GridView view = (GridView)sender;
            GridHitInfo hitInfo = view.CalcHitInfo(view.GridControl.PointToClient(Control.MousePosition));

            if (hitInfo.HitTest == GridHitTest.RowCell)
            {
                if ((hitInfo.Column != null) && (hitInfo.Column == colCCDH))
                {
                    string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colCCDID);
                    string strCCDID = "[CCDID] = \'" + strTemp + "\'";
                    if (fc["FrmPurchaseReceiveErrNote"] != null)
                    {
                        fc["FrmPurchaseReceiveErrNote"].Close();
                    }
                    FrmPurchaseReceiveErrNote FrmPREN = new FrmPurchaseReceiveErrNote(strCCDID);
                    FrmPREN.Show();
                    FrmPREN.Activate();
                }
            }
        }
Ejemplo n.º 2
0
        private void btnShowErrNote_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (selection.SelectedCount == 0)
            {
                MessageBox.Show("请先选择需要显示差错的记录");
            }
            else
            {
                string strCGSHID = null;
                for (int i = 0; i < selection.SelectedCount; ++i)
                {
                    int RowIndex = selection.GetSelectedRowIndex(i);
                    int RowHandle = gridView1.GetRowHandle(RowIndex);

                    string strTemp = gridView1.GetRowCellDisplayText(RowHandle, colCGSHID);
                    strCGSHID += "[CCDID] = \'" + strTemp + "\' Or ";
                }

                int index = strCGSHID.LastIndexOf("'");
                strCGSHID = strCGSHID.Substring(0, index + 1).Trim();

                FrmPurchaseReceiveErrNote FrmPREN = new FrmPurchaseReceiveErrNote(strCGSHID);
                FrmPREN.Show();
                FrmPREN.Activate();
            }
        }