The provided sample project and gif file are greatly appreciated.
If you generate the hierarchy automatically, note that you should notify the grid fr the inner level's changes after the drag-drop operation. One possible solution is to rebind the grid in the PreviewDragDrop
event in order to force rebuilding the automatically generated hierarchy which has been cached once the row is expanded. Alternatively, you can simply refresh all of the templates:
sender, RadDropEventArgs e)
var rowElement = e.DragInstance
var dropTarget = e.HitTarget
var targetGrid = dropTarget.ElementTree.Control
var dragGrid = rowElement.ElementTree.Control
(targetGrid == dragGrid)
//append dragged rows to the end of the target grid
index = dropTarget.Parent.Children.IndexOf(dropTarget);
//Grab every selected row from the source grid, including the current row
List<GridViewRowInfo> rows = dragGrid.SelectedRows.ToList<GridViewRowInfo>();
.MoveRows(targetGrid, dragGrid, rows, index);
I would recommend you to have a look at the following KB article demonstrating how to achieved CRUD operations in an object-relational hierarchy in RadGridView
manages user mouse and keyboard input over its rows by GridRowBehavior
. Depending on the row type, RadGridView
introduces different behaviors. After investigating the code in the sample project I have noticed that you register a custom GridDataRowBehavior
for the GridViewDataRowInfo
. When you have a hierarchical grid, note that you should implement a custom GridHierarchyRowBehavior
for the GridViewHierarchyRowInfos
as well. A full list of all row behaviors is available in the following help article: https://docs.telerik.com/devtools/winforms/controls/gridview/rows/row-behaviors
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Dess | Tech Support Engineer, Sr.
Get quickly onboarded and successful
with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.