| | |
| | | { |
| | | InitializeComponent(); |
| | | this.gridView1.SetNormalView(30); |
| | | behaviorManager1.Detach<DragDropBehavior>(gridView1); |
| | | } |
| | | |
| | | private List<FacilityViewModel> _allBindingList; |
| | |
| | | |
| | | private void barCkDrag_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | SetDragEnable(this.barCkDrag.Checked); |
| | | } |
| | | |
| | | //设置拖拽可用性 |
| | | private void SetDragEnable(bool allowArag) |
| | | { |
| | | var be = this.behaviorManager1.GetBehavior<DevExpress.Utils.DragDrop.DragDropBehavior>(this.gridView1); |
| | | be.Properties.AllowDrag = allowArag; |
| | | if (barCkDrag.Checked) |
| | | { |
| | | behaviorManager1.Attach<DragDropBehavior>(this.gridView1); |
| | | } |
| | | else |
| | | { |
| | | behaviorManager1.Detach<DragDropBehavior>(gridView1); |
| | | } |
| | | } |
| | | |
| | | private async void dragDropEvents1_DragDrop(object sender, DevExpress.Utils.DragDrop.DragDropEventArgs e) |
| | |
| | | TipFormHelper.ShowWarn("上移失败!"); |
| | | return; |
| | | } |
| | | var current = this.gridView1.GetRow(rowHandle) as PlaceViewModel; |
| | | var current = this.gridView1.GetRow(rowHandle) as FacilityViewModel; |
| | | if (current == null) |
| | | { |
| | | return; |
| | | } |
| | | var prevHandle = rowHandle - 1; |
| | | var prev = this.gridView1.GetRow(prevHandle) as PlaceViewModel; |
| | | var prev = this.gridView1.GetRow(prevHandle) as FacilityViewModel; |
| | | if (prev == null) |
| | | { |
| | | return; |
| | |
| | | TipFormHelper.ShowWarn("下移失败!"); |
| | | return; |
| | | } |
| | | var current = this.gridView1.GetRow(rowHandle) as PlaceViewModel; |
| | | var current = this.gridView1.GetRow(rowHandle) as FacilityViewModel; |
| | | if (current == null) |
| | | { |
| | | return; |
| | | } |
| | | var nextHandle = rowHandle + 1; |
| | | var next = this.gridView1.GetRow(nextHandle) as PlaceViewModel; |
| | | var next = this.gridView1.GetRow(nextHandle) as FacilityViewModel; |
| | | if (next == null) |
| | | { |
| | | return; |