| | |
| | | namespace HStation.WinFrmUI.Basic |
| | | using DevExpress.Utils.Behaviors; |
| | | using DevExpress.Utils.DragDrop; |
| | | using DevExpress.XtraTreeList; |
| | | |
| | | namespace HStation.WinFrmUI.Basic |
| | | { |
| | | public partial class SysPropManageMainPanel : DocumentPage |
| | | { |
| | |
| | | InitializeComponent(); |
| | | this.gridView1.SetNormalView(); |
| | | this.gridView1.RegistCustomDrawRowIndicator(); |
| | | this.PageTitle.Caption = "属性管理"; |
| | | this.PageTitle.HeaderSvgImage = this.svgImage32[0]; |
| | | this.PageTitle.SvgImageSize = new Size(24, 24); |
| | | this.propGroupTreeListCtrl1.FocusedChangedEvent += ModuleTreeListCtrl1_FocusedChangedEvent; |
| | | } |
| | | |
| | |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |
| | | |
| | | //排序 |
| | | private void barCheckItemSorter_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (barCheckSorter.Checked) |
| | | { |
| | | behaviorManager1.Attach<DragDropBehavior>(gridView1, behavior => |
| | | { |
| | | // behavior.BeginDragDrop += Behavior_BeginDragDrop; |
| | | behavior.EndDragDrop += Behavior_EndDragDrop; |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | behaviorManager1.Detach<DragDropBehavior>(gridView1); |
| | | } |
| | | } |
| | | |
| | | private async void Behavior_EndDragDrop(object sender, EndDragDropEventArgs e) |
| | | { |
| | | var vm = this.gridView1.GetCurrentViewModel(_allBindingList); |
| | | var sorterList = new List<Yw.Vmo.Sorter>(); |
| | | int i = 1; |
| | | foreach (var item in _allBindingList) |
| | | { |
| | | sorterList.Add(new Yw.Vmo.Sorter() { ID = item.ID, SortCode = i }); |
| | | i++; |
| | | } |
| | | if (await _bll.UpdateSorter(sorterList)) |
| | | { |
| | | this.propViewModelBindingSource.ResetBindings(false); |
| | | } |
| | | else |
| | | { |
| | | // gridView1.FocusedRowHandle = _LastRowIndex; |
| | | TipFormHelper.ShowError("修改排序失败!"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |