This is a migrated thread and some comments may be shown as answers.

Reorder RadListBox

1 Answer 415 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Kathryn asked on 05 Aug 2016, 09:34 PM

I am trying to implement a RadListBox that allows users to reorder the items within itself.  While I have found some old examples of this as well as the sdk examples, I keep getting the following error when I include the ItemContainerStyle reference:

"A style intended for type 'Telerik_Windows_Controls_RadListBox_0_206042439' cannot be applied to type 'ContentPresenter'.


In my XAML, I have this:


        <vm:AgentPreferencesViewModel x:Key="ViewModel" />
        <cnv:CheckBoxConverter x:Key="CheckBoxConverter" />
        <Style TargetType="telerik:RadListBox" x:Key="DraggableItem">
            <Setter Property="telerik:RadDragAndDropManager.AllowDrag" Value="True" />
            <Setter Property="telerik:RadDragAndDropManager.AllowDrop" Value="True" />
            <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True"/>


<telerik:RadListBox ItemContainerStyle="{StaticResource DraggableItem}"
                            ItemsSource="{Binding GridHeaders}"
                    <telerik:ScreenshotDragVisualProvider />
                    <telerik:ListBoxDragDropBehavior AllowReorder="True" />

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 08 Aug 2016, 07:06 AM
Hi Kathryn,

The Style set to ItemContainerStyle property of RadListBox should have its TargetType set to

RadListBoxItem (not RadListBox). 

I'd suggest you check the Drag and Drop Overview topic in our documentation as well as the ListBox Drag and Drop example at WPF Demos.

Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question