protected override void grvRef_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        LoadHeader();

        //_sql = "select NAME,custom_control_name from DMIS_SYS_COLUMNS where TABLE_ID=" + Session["MainTableId"].ToString() + " and ISDISPLAY=1 order by ORDER_ID";
        //_dt = DBOpt.dbHelper.GetDataTable(_sql);
        //for (int i = 0; i < _dt.Rows.Count; i++)
        //{
        //    grvRef.Rows[e.RowIndex].Cells[i + 1].Controls[0].ID = _dt.Rows[i][1].ToString();
        //}


        string sql;
        int    tableID, tid;

        tableID = Convert.ToInt16(Session["MainTableId"]);
        tid     = Convert.ToInt16(grvRef.DataKeys[e.RowIndex].Value);
        GridViewRow row = grvRef.Rows[e.RowIndex];

        sql = GridViewEdit.GetGridViewRowUpdating(ref grvRef, tableID, e.RowIndex, tid);
        sql = "update t_dd_running_log_type set name='测试' where tid=8";
        if (DBOpt.dbHelper.ExecuteSql(sql) > 0)
        {
            grvRef.EditIndex = -1;
            GridViewBind();
        }
        else
        {
            JScript.Alert((String)GetGlobalResourceObject("WebGlobalResource", "SaveFailMessage"));
            return;
        }
    }
 public GridViewEditAccessibleObject(GridViewEdit owner) : base(owner)
 {
     _owningPropertyGridView = owner.psheet;
     _owningGridViewEdit     = owner;
     _textProvider           = new TextBoxBaseUiaTextProvider(owner);
     UseTextProviders(_textProvider, _textProvider);
 }
Exemple #3
0
    protected void grv_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        if (sender == null)
        {
            return;
        }

        GridView grv = (GridView)sender;
        int      tid, tableID;

        tid     = Convert.ToInt16(grv.DataKeys[e.RowIndex].Value);
        tableID = Convert.ToInt16(Session["MainTableId"]);

        _sql = GridViewEdit.GetGridViewRowUpdating(ref grv, tableID, e.RowIndex, tid);

        if (DBOpt.dbHelper.ExecuteSql(_sql) > 0)
        {
            grv.EditIndex = -1;
            GridViewBind();
        }
        else
        {
            //JScript.Alert("数据保存失败!");
            return;
        }
    }
        public virtual void RefreshItem()
        {
            if (frmDataTable == null)
            {
                return;
            }

            if (GridViewEdit == null)
            {
                return;
            }

            int index = GridViewEdit.FocusedRowHandle;//原来的FocusedRowHandle

            GetCurrAllItem();

            frmDataTable.AcceptChanges();
            GridViewEdit.GridControl.DataSource = frmDataTable.DefaultView;//可能引发gridView1_FocusedRowChanged
            GridViewEdit.BestFitColumns();

            SetWMode("VIEW");
            if (index == GridViewEdit.FocusedRowHandle || frmDataTable.DefaultView.Count == 0)
            {
                //如果原来的FocusedRowHandle=新的FocusedRowHandle,
                //因为如果不等,则gridControl1.DataSource = dtDep.DefaultView会自动引发gridView1_FocusedRowChanged
                StaticFunctions.SetControlBindings(ParentControl, frmDataTable.DefaultView);
            }
        }
        private void ucp_onClosePopUp(object sender, DataRow drReturn)
        {
            if (strEnterGc == string.Empty)
            {
                return;
            }

            DataRow drInfo = GridViewEdit.GetFocusedDataRow();

            if (drInfo == null)
            {
                return;
            }

            ProduceManager.UcTxtPopup ucp = sender as ProduceManager.UcTxtPopup;
            drInfo[ucp.Tag.ToString()] = Convert.ToString(ucp.EditValue) == string.Empty ? DBNull.Value : ucp.EditValue;
            DataRow drContrl = StaticFunctions.GetContrRowValueById(dtShow, ucp.Name, ucp.Parent.Name);

            StaticFunctions.UpdateDataRowSynUcTxtPopup(drInfo, drReturn, drContrl["SetSynFields"].ToString(), drContrl["SetSynSrcFields"].ToString(), ucp);
            SetContrEditFromDpl(ucp.Parent, ucp.Name);
            if (!blPrevFindControl)
            {
                SetContrMoveNext(ucp.Name, false);
            }
            DoControlEvent(ucp, Convert.ToString(ucp.EditValue));
        }
Exemple #6
0
    protected void grv_RowEditing(object sender, GridViewEditEventArgs e)
    {
        if (sender == null)
        {
            return;
        }

        GridView grv = (GridView)sender;

        grv.EditIndex = e.NewEditIndex;
        grv.EditRowStyle.BackColor = System.Drawing.Color.FromName("#F7CE90");
        GridViewBind();

        int          tableID = Convert.ToInt16(Session["MainTableId"]);
        HtmlComboBox hcb厂站   = (HtmlComboBox)grv.Rows[e.NewEditIndex].FindControl("hcb厂站");
        //HtmlComboBox hcb联系人 = (HtmlComboBox)grv.Rows[e.NewEditIndex].FindControl("hcb联系人");
        DropDownList ddl类别  = (DropDownList)grv.Rows[e.NewEditIndex].FindControl("ddl类别");
        DropDownList ddl记录人 = (DropDownList)grv.Rows[e.NewEditIndex].FindControl("ddl记录人");

        //FillDropDownList.FillHtmlCombxByTable(ref hcb事件来源, "DMIS_SYS_DEPART", "NAME", "ID", "order_id", "TYPE='自动化记事'");
        FillDropDownList.FillHtmlCombxByTable(ref hcb厂站, "T_STATION_TYPE", "NAME", "TID", "NO");
        FillDropDownList.FillByTable(ref ddl类别, "T_ZDH_记事_类别参数", "名称", "TID", "序号");
        FillDropDownList.FillByTable(ref ddl记录人, "DMIS_VIEW_DEPART_MEMBER_ROLE", "MEMBER_NAME", "MEMBER_ID", "MEMBER_NAME", "ROLE_ID=4");

        int tid = Convert.ToInt16(grv.DataKeys[e.NewEditIndex].Value);

        GridViewEdit.GridViewEditing(ref grv, tableID, e.NewEditIndex, tid);
    }
        private void Txt_Enter(object sender, EventArgs e)
        {
            strFocusedContrName = (sender as Control).Name;
            FocusedControl      = sender as Control;

            Control ctrParent = FocusedControl.Parent;

            if (ctrParent != null)
            {
                if (strEnterGc != ctrParent.Name)
                {
                    strEnterGc    = ctrParent.Name;
                    ParentControl = GcOrdControls[strEnterGc];
                    arrContrSeq   = GcOrdarrContrSeq[strEnterGc];
                }
                if (FocusedControl.GetType().ToString() == "ProduceManager.UcTxtPopup")
                {
                    ProduceManager.UcTxtPopup ucp = FocusedControl as ProduceManager.UcTxtPopup;
                    ucp.DrFilterFieldsInfo = GridViewEdit.GetFocusedDataRow();
                }
                else if (FocusedControl.GetType().ToString() == "ProduceManager.UcTreeList")
                {
                    ProduceManager.UcTreeList ucp = FocusedControl as ProduceManager.UcTreeList;
                    ucp.DrFilterFieldsInfo = GridViewEdit.GetFocusedDataRow();
                }
            }
        }
Exemple #8
0
    protected void grv_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        if (sender == null)
        {
            return;
        }

        GridView grv = (GridView)sender;
        int      tid, tableID;

        string shiftDate = wdlDate.getTime().ToString("yyyyMMdd");

        tid     = Convert.ToInt16(grv.DataKeys[e.RowIndex].Value);
        tableID = Convert.ToInt16(Session["MainTableId"]);

        WebDate wdl发生时间, wdl结束时间;

        wdl发生时间 = (WebDate)grv.Rows[e.RowIndex].FindControl("wdl发生时间");
        wdl结束时间 = (WebDate)grv.Rows[e.RowIndex].FindControl("wdl结束时间");
        TimeSpan ts = DateTime.Now - DateTime.Now;   //不让两个相同时间相减,则会出现未赋局部变量的错误。
        string   updateSql;

        if (!(wdl结束时间.getTime() == null || wdl结束时间.getTime().ToString("yyyy") == "1900"))
        {
            DateTime dt1, dt2;
            dt1 = wdl发生时间.getTime();
            dt2 = wdl结束时间.getTime();
            if (dt1 > dt2)
            {
                JScript.Alert("发生时间不能大于结束时间!");
                return;
            }
            ts = dt2 - dt1;
        }
        else
        {
            updateSql = "update T_ZDH_自动化值班记事 set 小时数=NULL where TID=" + tid;   //取消小时数
            DBOpt.dbHelper.ExecuteSql(updateSql);
        }


        updateSql = GridViewEdit.GetGridViewRowUpdating(ref grv, tableID, e.RowIndex, tid);

        if (DBOpt.dbHelper.ExecuteSql(updateSql) > 0)
        {
            grv.EditIndex = -1;
            if (ts.TotalHours > 0)   //如果有时间再更新时间
            {
                updateSql = "update T_ZDH_自动化值班记事 set 小时数=" + ts.TotalHours.ToString() + " where TID=" + tid;
                DBOpt.dbHelper.ExecuteSql(updateSql);
            }
            GridViewBind();
        }
        else
        {
            JScript.Alert("数据保存失败!");
            return;
        }
    }
        private void lookUpEdit_Properties_Closed(object sender, DevExpress.XtraEditors.Controls.ClosedEventArgs e)
        {
            if (sender is DevExpress.XtraEditors.LookUpEdit)
            {
                DevExpress.XtraEditors.LookUpEdit dpl = sender as DevExpress.XtraEditors.LookUpEdit;
                if (!dpl.Properties.DisplayMember.Equals("Name"))
                {
                    dpl.Properties.DisplayMember = "Name";
                }

                if (strEnterGc == string.Empty)
                {
                    return;
                }

                DataRow drInfo = GridViewEdit.GetFocusedDataRow();
                if (drInfo == null)
                {
                    return;
                }

                drInfo[dpl.Tag.ToString()] = Convert.ToString(dpl.EditValue) == string.Empty ? DBNull.Value : dpl.EditValue;
                DataRow drContrl = StaticFunctions.GetContrRowValueById(dtShow, dpl.Name, dpl.Parent.Name);
                StaticFunctions.UpdateDataRowSynLookUpEdit(drInfo, dpl, drContrl["SetSynFields"].ToString(), drContrl["SetSynSrcFields"].ToString());
                SetContrEditFromDpl(dpl.Parent, dpl.Name);
                if (!blPrevFindControl)
                {
                    SetContrMoveNext(dpl.Name, false);
                }
                DoControlEvent(dpl, Convert.ToString(dpl.EditValue));
            }
            else if (sender is ExtendControl.ExtPopupTree)
            {
                if (strEnterGc == string.Empty)
                {
                    return;
                }

                DataRow drInfo = GridViewEdit.GetFocusedDataRow();
                if (drInfo == null)
                {
                    return;
                }

                ExtendControl.ExtPopupTree ept = sender as ExtendControl.ExtPopupTree;
                DataRow drContrl = StaticFunctions.GetContrRowValueById(dtShow, ept.Name, ept.Parent.Name);
                StaticFunctions.UpdateDataRowSynExtPopupTree(drInfo, ept, drContrl["SetSynFields"].ToString(), drContrl["SetSynSrcFields"].ToString());
                SetContrEditFromDpl(ept.Parent, ept.Name);
                DoControlEvent(ept, Convert.ToString(ept.EditValue));
            }
            else if (sender is DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit)
            {
                DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit dpl = sender as DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit;
                if (!dpl.DisplayMember.Equals("Name"))
                {
                    dpl.DisplayMember = "Name";
                }
            }
        }
        private void DoControlEvent(Control ctrl, string strValue)
        {
            if (Convert.ToString(ctrl.Tag) == string.Empty)
            {
                return;
            }
            if (strValue == string.Empty || strValue == "-9999")
            {
                return;
            }

            DataRow[] drControlSet = dtBtnsM.Select("IsControlSet=1 AND BtnName='" + ctrl.Name.ToString() + "'");
            if (drControlSet.Length <= 0)
            {
                return;
            }

            DataRow dr = GridViewEdit.GetFocusedDataRow();

            if (dr == null)
            {
                return;
            }

            DataRow drContr = drControlSet[0];

            try
            {
                string[] strValuesArr = drContr["OrdKeyValues"].ToString().Split(",".ToCharArray());
                foreach (string strValuesItem in strValuesArr)
                {
                    string[] strValues  = strValuesItem.Split("=".ToCharArray());
                    string   strCompute = strValues[1];
                    string[] strTags    = drContr["OrdKeyFields"].ToString().Split(",".ToCharArray());
                    foreach (string strTag in strTags)
                    {
                        if (strTag == ctrl.Tag.ToString())
                        {
                            strCompute = strCompute.Replace(strTag, strValue);
                        }
                        else
                        {
                            strCompute = strCompute.Replace(strTag, dr[strTag].ToString());
                        }
                    }
                    object snw     = new DataTable().Compute(strCompute, null);
                    string strKeyF = strValues[0];
                    dr[strKeyF] = snw;
                    dr.EndEdit();
                }
            }
            catch (Exception)
            {
            }
        }
    protected virtual void grvList_RowEditing(object sender, GridViewEditEventArgs e)
    {
        grvList.EditIndex = e.NewEditIndex;
        grvList.EditRowStyle.BackColor = System.Drawing.Color.FromName("#F7CE90");
        grvList_DataBind();

        int tableID, tid;

        tableID = Convert.ToInt16(Session["MainTableId"]);
        tid     = Convert.ToInt16(grvList.DataKeys[e.NewEditIndex].Value);
        GridViewEdit.GridViewEditing(ref grvList, tableID, e.NewEditIndex, tid);
    }
Exemple #12
0
    protected void grv_RowEditing(object sender, GridViewEditEventArgs e)
    {
        if (sender == null)
        {
            return;
        }

        GridView grv = (GridView)sender;

        grv.EditIndex = e.NewEditIndex;
        grv.EditRowStyle.BackColor = System.Drawing.Color.FromName("#F7CE90");
        GridViewBind();

        int tid = Convert.ToInt16(grv.DataKeys[e.NewEditIndex].Value);

        GridViewEdit.GridViewEditing(ref grv, Convert.ToInt16(Session["MainTableId"]), e.NewEditIndex, tid);
    }
    protected virtual void grvList_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        string sql;
        int    tableID, tid;

        tableID = Convert.ToInt16(Session["MainTableId"]);
        tid     = Convert.ToInt16(grvList.DataKeys[e.RowIndex].Value);
        sql     = GridViewEdit.GetGridViewRowUpdating(ref grvList, tableID, e.RowIndex, tid);
        if (DBOpt.dbHelper.ExecuteSql(sql) > 0)
        {
            grvList.EditIndex = -1;
            grvList_DataBind();
        }
        else
        {
            JScript.Alert((String)GetGlobalResourceObject("WebGlobalResource", "SaveFailMessage"));
            return;
        }
    }
Exemple #14
0
    //要填充DropDownList的值,无法使用祖先的代码
    protected override void grvRef_RowEditing(object sender, GridViewEditEventArgs e)
    {
        if (sender == null)
        {
            return;
        }

        GridView grv = (GridView)sender;

        grv.EditIndex = e.NewEditIndex;
        grv.EditRowStyle.BackColor = System.Drawing.Color.FromName("#F7CE90");
        GridViewBind();

        int          tableID     = Convert.ToInt16(Session["MainTableId"]);
        DropDownList ddlCATEGORY = (DropDownList)grv.Rows[e.NewEditIndex].FindControl("ddlCATEGORY");

        FillDropDownList.FillByTable(ref ddlCATEGORY, "T_STATION_RUNNING_LOG_TYPE", "NAME", "TID", "ORDER_ID");

        int tid = Convert.ToInt16(grv.DataKeys[e.NewEditIndex].Value);

        GridViewEdit.GridViewEditing(ref grv, tableID, e.NewEditIndex, tid);
    }
        private void uct_onClosePopUp(object sender)
        {
            if (strEnterGc == string.Empty)
            {
                return;
            }

            DataRow drInfo = GridViewEdit.GetFocusedDataRow();

            if (drInfo == null)
            {
                return;
            }

            ProduceManager.UcTreeList ucp = sender as ProduceManager.UcTreeList;
            if (!blPrevFindControl)
            {
                SetContrMoveNext(ucp.Name, false);
            }
            DataRow drContrl = StaticFunctions.GetContrRowValueById(dtShow, ucp.Name, ucp.Parent.Name);

            StaticFunctions.UpdateDataRowSynUcTreeList(drInfo, drContrl["SetSynFields"].ToString(), ucp);
        }
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            CApplication.App.CurrentSession.TimerId = 0;
            frmEditorBase frm = CApplication.CurrForm as frmEditorBase;

            if (frm == null)
            {
                return(base.ProcessCmdKey(ref msg, keyData));
            }

            int k = msg.WParam.ToInt32();

            blPrevFindControl = false;
            if (k == 123) //F12
            {
                if (CApplication.Com_Prot != null)
                {
                    CApplication.Com_Prot.port_Send();
                }
            }
            else if (k == 27)//Esc
            {
                frm.Close();
                frm.Dispose();
            }
            else if (k == 13)//Enter
            {
                if (string.IsNullOrEmpty(strFocusedContrName) || FocusedControl == null)
                {
                    return(base.ProcessCmdKey(ref msg, keyData));
                }
                if (!blNoEnterToSave)
                {
                    int index = arrContrSeq.IndexOf(strFocusedContrName);
                    if (index == arrContrSeq.Count - 1 && BtnEnterSave != null)
                    {
                        string strBtnType = BtnEnterSave.GetType().ToString();
                        if (strBtnType == "DevExpress.XtraEditors.SimpleButton")
                        {
                            (BtnEnterSave as SimpleButton).PerformClick();
                        }
                        else if (strBtnType == "DevExpress.XtraBars.BarButtonItem")
                        {
                            (BtnEnterSave as BarButtonItem).PerformClick();
                        }
                        return(base.ProcessCmdKey(ref msg, keyData));
                    }
                }
                if (FocusedControl is BaseEdit)
                {
                    BaseEdit bc = FocusedControl as BaseEdit;
                    if (bc.Properties.ReadOnly)
                    {
                        return(base.ProcessCmdKey(ref msg, keyData));
                    }
                }
                else if (FocusedControl is ProduceManager.UcTxtPopup)
                {
                    ProduceManager.UcTxtPopup bc = FocusedControl as ProduceManager.UcTxtPopup;
                    if (bc.ReadOnly)
                    {
                        return(base.ProcessCmdKey(ref msg, keyData));
                    }
                }
                else if (FocusedControl is ProduceManager.UcTreeList)
                {
                    ProduceManager.UcTreeList bc = FocusedControl as ProduceManager.UcTreeList;
                    if (bc.ReadOnly)
                    {
                        return(base.ProcessCmdKey(ref msg, keyData));
                    }
                }
                string strType = FocusedControl.GetType().ToString();
                if (strType == "DevExpress.XtraEditors.LookUpEdit")
                {
                    if (!(FocusedControl as DevExpress.XtraEditors.LookUpEdit).IsPopupOpen)
                    {
                        frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl);
                    }
                }
                else if (strType == "ExtendControl.ExtPopupTree")
                {
                    if (!(FocusedControl as ExtendControl.ExtPopupTree).IsPopupOpen)
                    {
                        frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl);
                    }
                }
                else if (strType == "ProduceManager.UcTxtPopup")
                {
                    if (!(FocusedControl as ProduceManager.UcTxtPopup).IsPopupOpen)
                    {
                        frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl);
                    }
                }
                else if (strType == "ProduceManager.UcTreeList")
                {
                    if (!(FocusedControl as ProduceManager.UcTreeList).IsPopupOpen)
                    {
                        frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl);
                    }
                }
                else
                {
                    frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl);
                }
            }
            else if (k == 187 || k == 107 || k == 227) // +
            {
                if (keyData.ToString().ToUpper().IndexOf("CONTROL") != -1)
                {
                    if (string.IsNullOrEmpty(strFocusedContrName) || FocusedControl == null)
                    {
                        return(base.ProcessCmdKey(ref msg, keyData));
                    }
                    if (FocusedControl is BaseEdit)
                    {
                        BaseEdit bc = FocusedControl as BaseEdit;
                        if (bc.Properties.ReadOnly)
                        {
                            return(base.ProcessCmdKey(ref msg, keyData));
                        }
                    }
                    else if (FocusedControl is ProduceManager.UcTxtPopup)
                    {
                        ProduceManager.UcTxtPopup bc = FocusedControl as ProduceManager.UcTxtPopup;
                        if (bc.ReadOnly)
                        {
                            return(base.ProcessCmdKey(ref msg, keyData));
                        }
                    }
                    else if (FocusedControl is ProduceManager.UcTreeList)
                    {
                        ProduceManager.UcTreeList bc = FocusedControl as ProduceManager.UcTreeList;
                        if (bc.ReadOnly)
                        {
                            return(base.ProcessCmdKey(ref msg, keyData));
                        }
                    }

                    string strType = FocusedControl.GetType().ToString();
                    if (strType == "DevExpress.XtraEditors.LookUpEdit" &&
                        (FocusedControl as DevExpress.XtraEditors.LookUpEdit).IsPopupOpen)
                    {
                        blPrevFindControl = true;
                        (FocusedControl as DevExpress.XtraEditors.LookUpEdit).ClosePopup();
                        blPrevFindControl = false;
                    }
                    else if (strType == "ExtendControl.ExtPopupTree" &&
                             (FocusedControl as ExtendControl.ExtPopupTree).IsPopupOpen)
                    {
                        blPrevFindControl = true;
                        (FocusedControl as ExtendControl.ExtPopupTree).ClosePopup();
                        blPrevFindControl = false;
                    }
                    else if (strType == "ProduceManager.UcTxtPopup" &&
                             (FocusedControl as ProduceManager.UcTxtPopup).IsPopupOpen)
                    {
                        blPrevFindControl = true;
                        (FocusedControl as ProduceManager.UcTxtPopup).ClosePopup();
                        blPrevFindControl = false;
                    }
                    else if (strType == "ProduceManager.UcTreeList" &&
                             (FocusedControl as ProduceManager.UcTreeList).IsPopupOpen)
                    {
                        blPrevFindControl = true;
                        (FocusedControl as ProduceManager.UcTreeList).ClosePopup();
                        blPrevFindControl = false;
                    }
                    frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl, 3);

                    return(true);
                }
            }
            else if (k == 189 || k == 109 || k == 229) // - //36:Home
            {
                if (keyData.ToString().ToUpper().IndexOf("CONTROL") != -1)
                {
                    if (string.IsNullOrEmpty(strFocusedContrName) || FocusedControl == null)
                    {
                        return(base.ProcessCmdKey(ref msg, keyData));
                    }
                    if (FocusedControl is BaseEdit)
                    {
                        BaseEdit bc = FocusedControl as BaseEdit;
                        if (bc.Properties.ReadOnly)
                        {
                            return(base.ProcessCmdKey(ref msg, keyData));
                        }
                    }
                    else if (FocusedControl is ProduceManager.UcTxtPopup)
                    {
                        ProduceManager.UcTxtPopup bc = FocusedControl as ProduceManager.UcTxtPopup;
                        if (bc.ReadOnly)
                        {
                            return(base.ProcessCmdKey(ref msg, keyData));
                        }
                    }
                    else if (FocusedControl is ProduceManager.UcTreeList)
                    {
                        ProduceManager.UcTreeList bc = FocusedControl as ProduceManager.UcTreeList;
                        if (bc.ReadOnly)
                        {
                            return(base.ProcessCmdKey(ref msg, keyData));
                        }
                    }
                    blPrevFindControl = true;

                    string strType = FocusedControl.GetType().ToString();
                    if (strType == "DevExpress.XtraEditors.LookUpEdit" &&
                        (FocusedControl as DevExpress.XtraEditors.LookUpEdit).IsPopupOpen)
                    {
                        (FocusedControl as DevExpress.XtraEditors.LookUpEdit).ClosePopup();
                    }
                    else if (strType == "ExtendControl.ExtPopupTree" &&
                             (FocusedControl as ExtendControl.ExtPopupTree).IsPopupOpen)
                    {
                        (FocusedControl as ExtendControl.ExtPopupTree).ClosePopup();
                    }
                    else if (strType == "ProduceManager.UcTxtPopup" &&
                             (FocusedControl as ProduceManager.UcTxtPopup).IsPopupOpen)
                    {
                        (FocusedControl as ProduceManager.UcTxtPopup).ClosePopup();
                    }
                    else if (strType == "ProduceManager.UcTreeList" &&
                             (FocusedControl as ProduceManager.UcTreeList).IsPopupOpen)
                    {
                        (FocusedControl as ProduceManager.UcTreeList).ClosePopup();
                    }
                    frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl);

                    return(true);
                }
            }
            else if (k == 33)//PgUp
            {
                if (GridViewEdit != null)
                {
                    GridViewEdit.MovePrev();
                    return(true);
                }
            }
            else if (k == 34)//PgDn
            {
                if (GridViewEdit != null)
                {
                    GridViewEdit.MoveNext();
                    return(true);
                }
            }
            else if (k == 46)//Delete
            {
                frm.DeleteFocusedItem();
                return(true);
                //if (GridViewEdit != null && GridViewEdit.GetFocusedDataRow() != null && frmEditorMode=="VIEW")
                //{
                //    frm.DeleteFocusedItem();
                //}
            }
            else if (k == 116)//F5
            {
                frm.RefreshItem();
                return(true);
            }
            else if (k == 20)//CapsLk
            {
                if (keyData.ToString().ToUpper().IndexOf("ALT") != -1)
                {
                    int idex = arrOpenedForms.IndexOf(this);
                    if (idex == -1)
                    {
                        return(true);
                    }

                    if (idex == 0)
                    {
                        idex = arrOpenedForms.Count - 1;
                    }
                    else
                    {
                        idex -= 1;
                    }


                    Form[] charr = this.ParentForm.MdiChildren;
                    foreach (Form chform in charr)
                    {
                        if (chform.Name.ToUpper() == arrOpenedForms[idex].Name.ToUpper())
                        {
                            chform.Show();
                            chform.Activate();

                            return(true);
                        }
                    }
                    return(true);
                }
            }

            return(base.ProcessCmdKey(ref msg, keyData));
        }
 public GridViewEditAccessibleObject(GridViewEdit owner) : base(owner)
 {
     propertyGridView = owner.psheet;
 }
Exemple #18
0
        protected override void Dispose(bool disposing) {
            if (disposing) {
                Debug.WriteLineIf(CompModSwitches.DebugGridView.TraceVerbose,  "PropertyGridView:Dispose");
                if (scrollBar != null) scrollBar.Dispose();
                if (listBox != null) listBox.Dispose();
                if (dropDownHolder != null) dropDownHolder.Dispose();
                scrollBar = null;
                listBox = null;
                dropDownHolder = null;

                ownerGrid = null;
                topLevelGridEntries = null;
                allGridEntries = null;
                serviceProvider = null;
                
                topHelpService = null;

                if (helpService != null && helpService is IDisposable)
                    ((IDisposable)helpService).Dispose();

                helpService = null;

                if (edit != null) {
                    edit.Dispose();
                    edit = null;
                }

                if (fontBold != null) {
                    fontBold.Dispose();
                    fontBold = null;

                }

                if (btnDropDown != null) {
                    btnDropDown.Dispose();
                    btnDropDown = null;
                }

                if (btnDialog != null) {
                    btnDialog.Dispose();
                    btnDialog = null;
                }

                if (toolTip != null) {
                    toolTip.Dispose();
                    toolTip = null;
                }
            }

            base.Dispose(disposing);
        }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (this.scrollBar != null)
         {
             this.scrollBar.Dispose();
         }
         if (this.listBox != null)
         {
             this.listBox.Dispose();
         }
         if (this.dropDownHolder != null)
         {
             this.dropDownHolder.Dispose();
         }
         this.scrollBar = null;
         this.listBox = null;
         this.dropDownHolder = null;
         this.ownerGrid = null;
         this.topLevelGridEntries = null;
         this.allGridEntries = null;
         this.serviceProvider = null;
         this.topHelpService = null;
         if ((this.helpService != null) && (this.helpService is IDisposable))
         {
             ((IDisposable) this.helpService).Dispose();
         }
         this.helpService = null;
         if (this.edit != null)
         {
             this.edit.Dispose();
             this.edit = null;
         }
         if (this.fontBold != null)
         {
             this.fontBold.Dispose();
             this.fontBold = null;
         }
         if (this.btnDropDown != null)
         {
             this.btnDropDown.Dispose();
             this.btnDropDown = null;
         }
         if (this.btnDialog != null)
         {
             this.btnDialog.Dispose();
             this.btnDialog = null;
         }
         if (this.toolTip != null)
         {
             this.toolTip.Dispose();
             this.toolTip = null;
         }
     }
     base.Dispose(disposing);
 }