public void dragDropManager_Dropped(object sender, DevExpress.Xpf.Grid.DragDrop.TreeListDroppedEventArgs e) { if (e.TargetNode != null) { foreach (TreeListNode obj in e.DraggedRows) { ROLECollection.Save((ROLE)obj.Content); } } }
public void dragDropManager_Dropped(object sender, DevExpress.Xpf.Grid.DragDrop.TreeListDroppedEventArgs e) { Guid newParentGuid = Guid.Empty; if (e.TargetNode != null) { foreach (TreeListNode obj in e.DraggedRows) { COMMODITY_CODE droppedCOMMODITY_CODE = obj.Content as COMMODITY_CODE; COMMODITY_CODE targetCommodityCode = (e.TargetNode.Content as COMMODITY_CODE); if (e.DropTargetType == DropTargetType.InsertRowsAfter) { droppedCOMMODITY_CODE.SORTORDER = targetCommodityCode.SORTORDER + 1; } else if (e.DropTargetType == DropTargetType.InsertRowsBefore) { droppedCOMMODITY_CODE.SORTORDER = targetCommodityCode.SORTORDER - 1; } else { IEnumerable <COMMODITY_CODE> targetCommodityCodeChild = this.Entities.Where(x => x.GUID_PARENT == targetCommodityCode.GUID); int maxTargetChildrenOrder = 0; if (targetCommodityCodeChild.Count() > 0) { maxTargetChildrenOrder = targetCommodityCodeChild.Max(x => x.SORTORDER); } maxTargetChildrenOrder += 1; droppedCOMMODITY_CODE.SORTORDER = maxTargetChildrenOrder; } newParentGuid = droppedCOMMODITY_CODE.GUID_PARENT; } uniqueGUID_PARENTS.Add(newParentGuid); ReorderAndSave(uniqueGUID_PARENTS); } }
private void dragDropManager_Dropped(object sender, DevExpress.Xpf.Grid.DragDrop.TreeListDroppedEventArgs e) { ((COMMODITY_CODESCollectionViewModel)this.DataContext).dragDropManager_Dropped(sender, e); }