New to Telerik UI for WPFStart a free 30-day trial

How to Cancel Drop Operation from LayoutControlToolBox to LayoutControl

Updated on Sep 15, 2025

Environment

Product Version2019.3.1023
ProductRadLayoutControl for WPF

Description

How to cancel the drop operation from the LayoutControlToolBox to the RadLayoutControl.

Solution

To disallow the drop of a particular item from the toolbox to the RadLayoutControl you need to handle the drag and drop events of the DragDropManager and more specifically, the DragOver event.

The example below shows how to cancel the drop of a LayoutControlExpanderGroup but this can also be modified to work for any element.

C#
    public MainWindow()
    {
        InitializeComponent();
        DragDropManager.AddDragOverHandler(this.layout, OnLayoutControlDragOver, false);
    }

    private void OnLayoutControlDragOver(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
    {
        var proxy = (LayoutControlHierarchicalNodeProxy)DragDropPayloadManager.GetDataFromObject(e.Data, "Telerik.Windows.Controls.LayoutControl.LayoutControlHierarchicalNodeProxy");

        if (proxy.OriginalItem is LayoutControlExpanderGroup)
        {
            e.Effects = DragDropEffects.None;
            e.Handled = true;
        }
    }

See Also