DxTreeList.DropTargetMode Property
Specifies the drop position behavior. Applicable only to drag and drop operations initiated externally.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(TreeListDropTargetMode.BetweenRows)]
[Parameter]
public TreeListDropTargetMode DropTargetMode { get; set; }
Property Value
Type | Default | Description |
---|---|---|
TreeListDropTargetMode | BetweenRows | An enumeration value. |
Available values:
Name | Description | Image |
---|---|---|
BetweenRows | The drop position is defined by TargetItem and DropPosition properties. |
|
Component | The drop position is not defined. You need to implement logic in the ItemsDropped event handler to specify where to insert rows. |
Remarks
Use the DropTargetMode
property to specify the drop position for rows dropped from external components. The BetweenRows
option displays the target indicator at a specific position. You can obtain this position in the ItemsDropped event handler (TargetItem and DropPosition event arguments).
The Component
option may be of use when you want to implement custom insertion logic in the ItemsDropped event handler (for example, if your data is sorted or grouped). The target indicator highlights the entire data area.
Note
If you allow users to sort data, the data source arranges data items based on sort settings. The component cannot guarantee a specific drop position and automatically switches to the Component
mode.
In the following snippet, the first TreeList accepts rows from the second TreeList. The DropTargetMode
property of the first TreeList is Component
.
<DxTreeList @ref="TreeList"
Data="CompletedTasks"
KeyFieldName="Id"
ParentKeyFieldName="ParentId"
ItemsDropped="TreeList_ItemsDropped"
DropTargetMode="GridDropTargetMode.Component">
<Columns>
<DxTreeListDataColumn FieldName="Name" Caption="Task" SortOrder="TreeListColumnSortOrder.Ascending" />
<DxTreeListDataColumn FieldName="EmployeeName" Caption="Assigned To" TextAlignment="TreeListTextAlignment.Left" Width="200px" />
<DxTreeListDataColumn FieldName="StartDate" Width="100px" />
<DxTreeListDataColumn FieldName="DueDate" Width="100px" />
</Columns>
</DxTreeList>
<DxTreeList @ref="TreeList"
Data="PendingTasks"
KeyFieldName="Id"
ParentKeyFieldName="ParentId"
AllowDragRows="true"
AllowedDropTarget="GridAllowedDropTarget.External">
<Columns>
<DxTreeListDataColumn FieldName="Name" Caption="Task" SortOrder="TreeListColumnSortOrder.Ascending" />
<DxTreeListDataColumn FieldName="EmployeeName" Caption="Assigned To" TextAlignment="TreeListTextAlignment.Left" Width="200px" />
<DxTreeListDataColumn FieldName="StartDate" Width="100px" />
<DxTreeListDataColumn FieldName="DueDate" Width="100px" />
</Columns>
</DxTreeList>