Exemple #1
0
 /// <summary>
 /// 选择节点之前设定控件状态
 /// </summary>
 private void treeListWorkFlows_BeforeFocusNode(object sender, DevExpress.XtraTreeList.BeforeFocusNodeEventArgs e)
 {
     try
     {
         if (bSWorkFlows.Current != null)
         {
             //if (((DataRowView)bSWorkFlows.Current).IsEdit)
             {
                 int     oldId = e.OldNode == null ? -1 : DataTypeConvert.GetInt(e.OldNode["AutoId"]);
                 DataRow dr    = ((DataRowView)bSWorkFlows.Current).Row;
                 if (dr.RowState == DataRowState.Added && oldId != -1)
                 {
                     return;
                 }
                 else
                 {
                     dr.RejectChanges();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException(this.Text + "--选择节点之前设定控件状态错误。", ex);
     }
 }
Exemple #2
0
        private void eventTreeList_BeforeFocusNode(object sender, DevExpress.XtraTreeList.BeforeFocusNodeEventArgs e)
        {
            //不懂。。。。这几句是什么意思?
            TreeListNode tn = e.OldNode;

            if (tn == null)
            {
                return;
            }
            TreeList_Event.CloseEditor();
        }
 private void trvLstMain_BeforeFocusNode(object sender, DevExpress.XtraTreeList.BeforeFocusNodeEventArgs e)
 {
     if (_TreeListHoster != null && _TreeListHoster.TreeViewCfg != null &&
         _TreeListHoster.TreeViewCfg.OnlyLeafNodeSelectable)
     {
         if (e.Node.HasChildren)
         {
             e.CanFocus = false;
         }
     }
 }
Exemple #4
0
 private void treeList1_BeforeFocusNode(object sender, DevExpress.XtraTreeList.BeforeFocusNodeEventArgs e)
 {
     if (btnSave.Enabled)
     {
         DialogResult dr = Dialog.MessageBox("当前模板修改未保存,是否确定要离开?", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (dr == DialogResult.Yes)
         {
         }
         else
         {
             e.CanFocus = false;
         }
     }
 }
Exemple #5
0
 private void treeList1_BeforeFocusNode(object sender, DevExpress.XtraTreeList.BeforeFocusNodeEventArgs e)
 {
     if (e.Node.GetValue("Message") == null)
     {
         latestParentNodeId = e.Node.Id;
         if (curOper == Oper.PrevPlay)
         {
             treeList1.MovePrev();
         }
         else
         {
             treeList1.MoveNext();
         }
     }
 }
Exemple #6
0
        private void cxDBTreeList1_BeforeFocusNode(object sender, DevExpress.XtraTreeList.BeforeFocusNodeEventArgs e)
        {
            if (e.Node == e.OldNode || e.OldNode == null)
            {
                return;
            }

            //if (e.Node == cxDBTreeList1.Nodes.AutoFilterNode)
            //    return;

            if (e.OldNode != null)
            {
                //if (!Validation(e.OldNode))
                //    e.CanFocus = false;

                if (!Validation(e.OldNode))
                {
                    e.CanFocus = false;
                }
            }
        }
Exemple #7
0
 private void treeList1_BeforeFocusNode(object sender, DevExpress.XtraTreeList.BeforeFocusNodeEventArgs e)
 {
     e.CanFocus = Save(false);
 }
Exemple #8
0
 private void treeList1_BeforeFocusNode(object sender, DevExpress.XtraTreeList.BeforeFocusNodeEventArgs e)
 {
 }
Exemple #9
0
 private void treeListParams_BeforeFocusNode(object sender, DevExpress.XtraTreeList.BeforeFocusNodeEventArgs e)
 {
     colParamValue.OptionsColumn.AllowEdit = (e.Node.HasChildren == false);
 }
Exemple #10
0
        /// <summary>
        /// 列表聚焦改变刷新当前选中行的信息
        /// </summary>
        private void resourcesTreePlanTask_BeforeFocusNode(object sender, DevExpress.XtraTreeList.BeforeFocusNodeEventArgs e)
        {
            try
            {
                if (bSProjectPlanTask.Current != null && !isLockGrid)
                {
                    bSProjectPlanTask.EndEdit();
                    DataRow dr = ((DataRowView)bSProjectPlanTask.Current).Row;
                    if (e.OldNode != null)
                    {
                        int       oldAutoId = DataTypeConvert.GetInt(e.OldNode["AutoId"]);
                        DataRow[] olddrs;
                        if (oldAutoId == 0)
                        {
                            olddrs = TableProjectPlanTask.Select("AutoId is null");
                        }
                        else
                        {
                            olddrs = TableProjectPlanTask.Select(string.Format("AutoId = {0}", oldAutoId));
                        }

                        if (olddrs.Length > 0 && dr == olddrs[0])
                        {
                            if (dr.RowState != DataRowState.Unchanged)
                            {
                                if (MessageHandler.ShowMessageBox_YesNo("确认是否保存当前行信息?") == DialogResult.Yes)
                                {
                                    if (!editForm.btnSave_Click())
                                    {
                                        e.CanFocus = false;
                                        return;
                                    }
                                }
                                else
                                {
                                    dr.RejectChanges();
                                    editForm.Set_Button_State(true);
                                    editForm.Set_EditZone_ControlReadOnly(true);
                                }
                            }
                            else
                            {
                                editForm.Set_Button_State(true);
                                editForm.Set_EditZone_ControlReadOnly(true);
                            }
                        }
                    }

                    if (e.Node != null)
                    {
                        DataRow[] newdrs = TableProjectPlanTask.Select(string.Format("AutoId = {0}", DataTypeConvert.GetInt(e.Node["AutoId"])));
                        if (newdrs.Length > 0)
                        {
                            bSProjectPlanTask.Position = TableProjectPlanTask.Rows.IndexOf(newdrs[0]);
                            if (resourcesTreePlanTask.FocusedNode == null)
                            {
                                bSProjectPlanTask_PositionChanged(null, null);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(this.Text + "--列表聚焦改变刷新当前选中行的信息错误。", ex);
            }
        }