Hi Marcelo,
Thanks for contacting Syncfusion support.
We have validated your reported problem in Syncfusion Blazor TreeView component. We would like to let you know that NodeDropped event triggers after the node was completely dropped on the target. Currently, we haven’t provided support to cancel this action. For achieving your requirement, we suggest you to use the OnNodeDragStop event. By using this event, we can prevent the node drop action. Please refer to the below code block.
|
<SfTreeView TValue="TeamDetails" AllowDragAndDrop="true">
<TreeViewEvents TValue="TeamDetails" OnNodeDragStop="NodeDragStop"></TreeViewEvents>
<TreeViewFieldsSettings TValue="TeamDetails" Id="Id" Text="Name" Child="Children" DataSource="@Team" Expanded="Expanded"></TreeViewFieldsSettings>
</SfTreeView>
@code{
bool condition = true;
public async void NodeDragStop(DragAndDropEventArgs args)
{
if (condition == true)
{
args.Cancel = true;
}
} |
We have also prepared sample application to meet your requirement, which can be downloaded from the below link.
Please refer to the below links to know more about TreeView component.
Please confirm whether the provided solution is met your requirement or do you expecting this support need to be included in NodeDropped event ?
Regards,
Muthukrishnan K