How to call the ActivateItemReorderForItem method

Thread is closed for posting
3 posts, 0 answers
  1. Sergio
    Sergio avatar
    18 posts
    Member since:
    May 2014

    Posted 27 Jan 2015 Link to this post

    Hello, I'm working with a DataBoundListBox and I can't find a way to get the right RadDataBoundListBoxItem instance to pass to the ActivateItemReorderForItem method. Here is a part of my code.

    This is the DataTemplate for every element inside my ListBox
            <DataTemplate x:Key="ListBoxItemTemplate">
                <ContentControl Holding="ContentControl_Holding">
                            <converters:FolderContentConverter x:Key="FolderConverter"/>
                            <ColumnDefinition Width="0.2*"/>
                            <ColumnDefinition Width="*"/>
                        <Grid Margin="10">
                            <Canvas Background="{StaticResource PhoneAccentBrush}"/>
                            <Image Source="/Assets/MainUI/folder.png"/>
                        <StackPanel Grid.Column="1">
                            <TextBlock Text="{Binding Name}"
                            <TextBlock Text="{Binding FolderContent, Converter={StaticResource FolderConverter}}"

    And this is my listBox:
    <Primitives:RadDataBoundListBox x:Name="listBox"
                       ItemsSource="{Binding Source}"
                       ItemTemplate="{StaticResource ListBoxItemTemplate}"

    My source is an ObservableCollection. How can I pick an element from that collection and enable the itemReorderMode for that element?
    I need the IsItemReorderEnabled parameter to be set to False, and I just want to enable that mode for a given item programmaticaly.
    That method only accepts a RadDataBoundListBoxItem object, and I don't know how to get that from the actual element I pick from my ObservableCollection.

    Thanks in advance :)
  2. Ves
    Ves avatar
    2924 posts

    Posted 30 Jan 2015 Link to this post

    Hi Sergio,

    You can use the GetContainerForItem method of RadDataBoundListBox. It accepts an object parameter -- an element from your observable collection, and returns a RadDataBoundListBoxItem.

    Best regards,

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. Sergio
    Sergio avatar
    18 posts
    Member since:
    May 2014

    Posted 30 Jan 2015 in reply to Ves Link to this post

    Hello, thank you for your answer!
    I didn't see those two methods as they returned a RadVirtualizationDataControlItem, I just realized that a RadDataBoundListBox inherits that class, by bad :D
    Thank you again for your help!

Back to Top