private void treeList2_MouseDoubleClick(object sender, MouseEventArgs e) { DevExpress.XtraTreeList.TreeList gv = sender as DevExpress.XtraTreeList.TreeList; DevExpress.XtraTreeList.TreeListHitInfo hi = gv.CalcHitInfo(e.Location); if (hi.Node != null) { object o = gv.GetDataRecordByNode(hi.Node); DataRowView info = o as DataRowView; string str = string.Empty; if (info["LB"].Equals("清单")) { str = info["XMMC"].ToString(); } else { if (info["SSLB"].Equals(0)) { str = "分部分项"; } } if (str != string.Empty) { DataRowView view = this.bindingSource1.Current as DataRowView; if (view != null) { view.BeginEdit(); view["location"] = str; view.EndEdit(); this.treeList1.HideEditor(); } } } }
private void treeList1_DoubleClick(object sender, EventArgs e) { try { DevExpress.XtraTreeList.TreeList tree = sender as DevExpress.XtraTreeList.TreeList; DevExpress.XtraTreeList.TreeListHitInfo hi = tree.CalcHitInfo(tree.PointToClient(Control.MousePosition)); if (hi.Node != null) { CTechCore.Models.Navigation.Menus.MenuItem mnu = new CTechCore.Models.Navigation.Menus.MenuItem(((DataRowView)tree.GetDataRecordByNode(tree.Selection[0])).Row); if (mnu.DisplayAllFormBeforeLoad) { CTechCore.Models.Navigation.Menus.DisplayListAll(mnu); } else { CTechCore.Models.Navigation.Menus.LoadEntityForm(mnu); } } } catch (Exception ex) { string msg = $"Error loading screen : {ex.Message}.\r\n {ex.StackTrace}"; if (ex.InnerException != null) { msg += ex.InnerException.ToString(); } MessageBox.Show(msg); MyApp.Log.WriteEntry(msg, System.Diagnostics.EventLogEntryType.Error); } }
private void treeListEx1_MouseDoubleClick(object sender, MouseEventArgs e) { DevExpress.XtraTreeList.TreeList tl = sender as DevExpress.XtraTreeList.TreeList; DevExpress.XtraTreeList.TreeListHitInfo tinfo = tl.CalcHitInfo(e.Location); if (tinfo.Node != null) { sform.subSegmentListData1.FocusedNode(ToolKit.ParseInt(tinfo.Node.GetValue("ID"))); } }
private TreeListNode _TargetNodeAfterMouseRightClick;//右键点击以后的节点 private void trvLstMain_MouseDown(object sender, MouseEventArgs e) { DevExpress.XtraTreeList.TreeList tree = sender as DevExpress.XtraTreeList.TreeList; DevExpress.XtraTreeList.TreeListHitInfo hitInfo = tree.CalcHitInfo(e.Location); if (e.Button == MouseButtons.Right && hitInfo.HitInfoType == DevExpress.XtraTreeList.HitInfoType.Cell) { _TargetNodeAfterMouseRightClick = hitInfo.Node; } }
private void treeListEx1_MouseDoubleClick(object sender, MouseEventArgs e) { DevExpress.XtraTreeList.TreeList gv = sender as DevExpress.XtraTreeList.TreeList; DevExpress.XtraTreeList.TreeListHitInfo hi = gv.CalcHitInfo(e.Location); if (hi.Node != null) { object obj = this.treeListEx1.GetDataRecordByNode(hi.Node); if (!this.treeListEx1.CheckNodes.Contains(obj)) { this.treeListEx1.CheckNodes.Add(obj); } this.DialogResult = DialogResult.OK; } }
private void ucseg_menu_x_empresa_x_usuario1_event_delegate_treeList_menu_MouseDown(object sender, MouseEventArgs e) { try { DevExpress.XtraTreeList.TreeList tree = (DevExpress.XtraTreeList.TreeList)sender; DevExpress.XtraTreeList.TreeListHitInfo hitInfo = tree.CalcHitInfo(e.Location); if (hitInfo.HitInfoType == DevExpress.XtraTreeList.HitInfoType.Cell) { SeleccionarNodo(hitInfo.Node); } } catch (Exception ex) { } }
private void treeList1_MouseUp(object sender, MouseEventArgs e) { DevExpress.XtraTreeList.TreeList gv = sender as DevExpress.XtraTreeList.TreeList; DevExpress.XtraTreeList.TreeListHitInfo hi = gv.CalcHitInfo(e.Location); if (e.Button == MouseButtons.Right) { if (this.Activitie == null) { return; } if (this.bindingSource1.Count > 0) { // this.popupMenu1.ShowPopup(Control.MousePosition); } } }
private void ucseg_menu_x_empresa_x_usuario1_event_delegate_treeList_menu_MouseDown(object sender, MouseEventArgs e) { try { DevExpress.XtraTreeList.TreeList tree = (DevExpress.XtraTreeList.TreeList)sender; DevExpress.XtraTreeList.TreeListHitInfo hitInfo = tree.CalcHitInfo(e.Location); if (hitInfo.HitInfoType == DevExpress.XtraTreeList.HitInfoType.Cell) { SeleccionarNodo(hitInfo.Node); } } catch (Exception) { MessageBox.Show("Ha ocurrido un error, comuníquese con sistemas", param.nom_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//鼠标点击的节点设为焦点 private void treeList1_MouseDown(object sender, MouseEventArgs e) { DevExpress.XtraTreeList.TreeList treelist = sender as DevExpress.XtraTreeList.TreeList; if (treelist == null) { return; } Point pt = new Point(e.X, e.Y); DevExpress.XtraTreeList.TreeListHitInfo ht = treeList1.CalcHitInfo(pt); if (ht != null && ht.Node != null) { treeList1.FocusedNode = ht.Node; } treeList1.OptionsBehavior.Editable = false; treeList1.CloseEditor(); }
void ucSeg_Menu_x_Usuario_x_Empresa1_event_treeListMenu_x_Usuario_x_Empresa_MouseDown(object sender, MouseEventArgs e) { try { DevExpress.XtraTreeList.TreeList tree = (DevExpress.XtraTreeList.TreeList)sender; DevExpress.XtraTreeList.TreeListHitInfo hitInfo = tree.CalcHitInfo(e.Location); if (hitInfo.HitInfoType == DevExpress.XtraTreeList.HitInfoType.Cell) { SeleccionarNodo(hitInfo.Node); } } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; NameMetodo = NameMetodo + " - " + ex.ToString(); MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
private DragDropEffects GetProjectTreeDragDropEffect(DevExpress.XtraTreeList.TreeList tl, TreeListNode dragNode) { Point p = tl.PointToClient(MousePosition); var targetNode = tl.CalcHitInfo(p).Node; if (dragNode == null || targetNode == null || dragNode == targetNode) { return(DragDropEffects.None); } if (dragNode.Tag == null || targetNode.Tag == null) { return(DragDropEffects.None); } var t1 = dragNode.Tag.GetType(); var t2 = targetNode.Tag.GetType(); if (t1 == typeof(ViewportInfo) || t1.IsSubclassOf(typeof(ViewportInfo))) { if (t2 != t1) { return(DragDropEffects.None); } if (dragNode.ParentNode != targetNode.ParentNode) { return(DragDropEffects.None); } } else if (t1.IsSubclassOf(typeof(ElementInfo))) { if (!t2.IsSubclassOf(typeof(ElementInfo)) && !(t2 == typeof(ViewportInfo) || t2.IsSubclassOf(typeof(ViewportInfo)))) { return(DragDropEffects.None); } } return(DragDropEffects.Move); }