注意,分组不可用:下图为例的,分组不可用

引用:
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
声明:
DataTable _DT = new DataTable();
在 Load 事件里面添加:
this.gridControl1.AllowDrop = true; // 确保能够拖拽
this.gridView1.OptionsSelection.MultiSelect = true; //确保能够多选
this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false; //确保选定行的背景色一样
this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false; //确保选定行的背景色一样。
this.gridView1.OptionsBehavior.Editable = false;
this.gridControl1.DragDrop += gridControl1_DragDrop;
this.gridControl1.DragOver += gridControl1_DragOver;
this.gridView1.MouseMove += gridView1_MouseMove;
this.gridView1.MouseDown += gridView1_MouseDown;
_v织布日报BindingSource.DataSource = _DT;
内容:
#region

本文介绍如何使用 DevExpress 的 Grid 控件实现数据行的拖拽交换功能。通过一系列的事件监听与处理,使得用户可以直观地通过拖拽操作来改变数据行的位置。此功能适用于需要频繁调整数据顺序的应用场景。
最低0.47元/天 解锁文章
1367

被折叠的 条评论
为什么被折叠?



