2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
Dragging and dropping for merged cellsBy Default, GridControl Drag and Drop operation is done for merged cells. But merge cell cannot be moved as merged cell. For more information, please refer the below image,
Solution In order to achieve drag and drop of merged cells, QueryCanOleDragRange event can be used and merged cell will be considered as individual cells by adding the drag and drop range to selection. So that merge cells also can be dragged to another place as merge cells.
C# //QueryCanOleDragRange event. void gridControl1_QueryCanOleDragRange(object sender, GridQueryCanOleDragRangeEventArgs e) { if (e.Range.Left != e.Range.Right || e.Range.Top!=e.Range.Bottom) this.gridControl1.Selections.Add(e.Range); }
VB ‘QueryCanOleDragRange event. Private Sub gridControl1_QueryCanOleDragRange(ByVal sender As Object, ByVal e As GridQueryCanOleDragRangeEventArgs) If e.Range.Left <> e.Range.Right OrElse e.Range.Top<>e.Range.Bottom Then Me.gridControl1.Selections.Add(e.Range) End If End Sub
Screenshot
Samples:
Reference link: https://help.syncfusion.com/windowsforms/grid-control/drag-and-drop#blocking-the-data-before-dragging |
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.