Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
138253
How to allow dragging multiple Records from XamDataGrid to XamDataTree?
posted

    XamDataGrid provide the ability to select multiple records by setting the SelectionTypeRecord to Extended from its FieldLayoutSettings. After setting that property using the Drag and Drop functionality it can be allowed dragging the selected records from the XamDataGrid onto the XamDataTree. When dropped, the selected records of the XamDataGrid can be added to the XamDataTree as nodes. The attached sample application demonstrates an approach for implementing this behavior. The approach uses a Style for the DataRecordPresenter with an EventSetter in it, for the MouseDown event. In the event handler the drag process is stared using the DoDragDrop static method of the DragDrop class. In order to accept the currently dragged records from the XamDataGrid, the XamDataTree should has its AllowDrop property set to True. The dragged records are added to the XamDataTree in the event handler for its Drop event.

XamDataGridToXamDataTreeMultipleRecordsDragging.zip