Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Reorder RadListBox

$
0
0

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:

......

<UserControl.Resources>
        <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"/>
        </Style>
    </UserControl.Resources>

......

<telerik:RadListBox ItemContainerStyle="{StaticResource DraggableItem}"
                            ItemsSource="{Binding GridHeaders}"
                            DisplayMemberPath="Name"
                            Grid.Column="0"
                            Grid.Row="0"
                            Margin="20">
                <telerik:RadListBox.DragVisualProvider>
                    <telerik:ScreenshotDragVisualProvider />
                </telerik:RadListBox.DragVisualProvider>
                <telerik:RadListBox.DragDropBehavior>
                    <telerik:ListBoxDragDropBehavior AllowReorder="True" />
                </telerik:RadListBox.DragDropBehavior>
            </telerik:RadListBox>


Viewing all articles
Browse latest Browse all 78072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>