private void treeList1_CalcNodeDragImageIndex(object sender, CalcNodeDragImageIndexEventArgs e) { try { if (e.Node[treeListColumn3].ToString() == "Folder") { e.ImageIndex = 0; } if (e.Node[treeListColumn3].ToString() == "File") { if (e.Node.ParentNode == treeList1.FocusedNode.ParentNode) { e.ImageIndex = -1; return; } if (e.ImageIndex == 0) { if (e.Node.Id > treeList1.FocusedNode.Id) { e.ImageIndex = 2; } else { e.ImageIndex = 1; } } } } catch { } }
private void tlItem_CalcNodeDragImageIndex(object sender, CalcNodeDragImageIndexEventArgs e) { TreeList tl = sender as TreeList; if (GetDragDropEffect(tl, tl.FocusedNode) == DragDropEffects.None) { e.ImageIndex = -1; // no icon } else { e.ImageIndex = 1; // the reorder icon (a curved arrow) } }
void treeList_CalcNodeDragImageIndex(object sender, CalcNodeDragImageIndexEventArgs e) { DXDragEventArgs ea = TreeList.GetDXDragEventArgs(e.DragArgs); if (!object.Equals(ea.RootNode, ea.TargetRootNode)) { e.ImageIndex = -1; } else { e.ImageIndex = 1; } }
private void calcNodeDragImageIndex(CalcNodeDragImageIndexEventArgs e) { var selectedNodes = getSelectedTreeNodes(); if (getDragDropEffect(selectedNodes) == DragDropEffects.None) { e.ImageIndex = -1; // no icon } else { e.ImageIndex = 2; // the reorder icon (a curved arrow) } }
private void TreeList1_CalcNodeDragImageIndex(object sender, CalcNodeDragImageIndexEventArgs e) { TreeList tl = sender as TreeList; DXDragEventArgs args = e.DragArgs.GetDXDragEventArgs(tl); TreeListNode node = args.Data.GetData(typeof(TreeListNode)) as TreeListNode; // draging treelist item if (node != null) { // invalid drop location, show nothing if (GetDragDropEffect(tl, node) == DragDropEffects.None) { e.ImageIndex = -1; } // dropping a child onto a parent, show INSERT arrow else if (args.TargetNode.Level == 0 && node.Level > 0) { e.ImageIndex = 0; } // otherwise show AFTER arrow else { e.ImageIndex = 2; } } // dragging grid row else { EstimateProjectType pt = args.Data.GetData(typeof(EstimateProjectType)) as EstimateProjectType; EstimateCalculator calc = args.Data.GetData(typeof(EstimateCalculator)) as EstimateCalculator; bool isProject = pt != null; //object gridObject = args.Data.GetData(typeof(object)); // invalid drop location, show nothing DragDropEffects dde; if (isProject) { dde = GetDragDropEffect(tl, pt); } else { dde = GetDragDropEffect(tl, calc); } if (dde == DragDropEffects.None) { e.ImageIndex = -1; // no icon } // dropping a CALCULATOR onto a parent, show INSERT arrow else if (args.TargetNode.Level == 0 && !isProject) { e.ImageIndex = 0; } // otherwise show AFTER arrow else { e.ImageIndex = 2; } } }
private void treeView_CalcNodeDragImageIndex( object sender, CalcNodeDragImageIndexEventArgs e) { var tree = (TreeList)sender; if (getDragDropEffect(tree, tree.FocusedNode) == DragDropEffects.None) { e.ImageIndex = -1; // no icon } else { e.ImageIndex = 1; // the reorder icon (a curved arrow) } }