SVN r1180
SVN-Revision: r1180
This commit is contained in:
@@ -1285,6 +1285,18 @@ namespace Lskj.Control
|
||||
{
|
||||
dragRowsIndex = gcMain.GridView.GetSelectedRows();
|
||||
|
||||
// 复选框多选时,只允许从已选中行发起拖拽。
|
||||
// 如果从未选中行拖拽,不移动已勾选行,避免拖拽对象和选中对象不一致。
|
||||
if (dragRowsIndex != null
|
||||
&& dragRowsIndex.Length > 1
|
||||
&& !dragRowsIndex.Contains(_hit.RowHandle))
|
||||
{
|
||||
m_dragHandle = -1;
|
||||
isSortDrag = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
m_dragHandle = _hit.RowHandle;
|
||||
m_mouseDownLocation = e.Location;
|
||||
}
|
||||
@@ -1352,6 +1364,31 @@ namespace Lskj.Control
|
||||
int endIndex = -1;
|
||||
if (m_dragRowShadow != null)
|
||||
{
|
||||
|
||||
bool isMultiDrag = dragRowsIndex != null && dragRowsIndex.Length > 1;
|
||||
if (isMultiDrag)
|
||||
{
|
||||
bool hasOtherSort = gcMain.GridView.SortedColumns
|
||||
.Cast<DevExpress.XtraGrid.Columns.GridColumn>()
|
||||
.Any(x => !string.Equals(x.FieldName, DetailOrderField, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (hasOtherSort)
|
||||
{
|
||||
m_dragRowShadow.Close();
|
||||
m_dragRowShadow.Dispose();
|
||||
m_dragRowShadow = null;
|
||||
|
||||
isSortDrag = false;
|
||||
m_dragHandle = -1;
|
||||
|
||||
gcMain.GridView.Columns.ClearAllSort();
|
||||
MessageUtil.Show("多选时不能存在其它列排序,已清除排序,请重新拖拽排序。");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var _hit = gcMain.GridView.CalcHitInfo(e.Location);
|
||||
|
||||
this.EndDrag(_hit.RowHandle);
|
||||
|
||||
Reference in New Issue
Block a user