Issues with ItemReorder

10 posts, 0 answers
  1. Olu
    Olu avatar
    10 posts
    Member since:
    Dec 2010

    Posted 24 Jun 2012 Link to this post

    Hi,

    I'm having a number of issues with ItemReorderEnabled=True on DataBoundList.

    When I tap+hold I get error message below:
    System.InvalidOperationException was unhandled
      Message=Element is already the child of another element.
      StackTrace:
           at MS.Internal.XcpImports.VisualStateManager_GoToState(Control reference, String StateName, Boolean useTransitions, Boolean& refreshInheritanceContext)
           at System.Windows.VisualStateManager.GoToState(Control control, String stateName, Boolean useTransitions)
           at Telerik.Windows.Controls.RadDataBoundListBox.OnItemHold(RadDataBoundListBoxItem item, GestureEventArgs args)
           at Telerik.Windows.Controls.RadDataBoundListBoxItem.OnHold(GestureEventArgs e)
           at System.Windows.Controls.Control.OnHold(Control ctrl, EventArgs e)
           at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

    Some times I also get the following:
    System.InvalidOperationException was unhandled
      Message=Cannot resolve TargetName RootScale.
      StackTrace:
           at MS.Internal.XcpImports.VisualStateManager_GoToState(Control reference, String StateName, Boolean useTransitions, Boolean& refreshInheritanceContext)
           at System.Windows.VisualStateManager.GoToState(Control control, String stateName, Boolean useTransitions)
           at Telerik.Windows.Controls.RadDataBoundListBox.OnItemHold(RadDataBoundListBoxItem item, GestureEventArgs args)
           at Telerik.Windows.Controls.RadDataBoundListBoxItem.OnHold(GestureEventArgs e)
           at System.Windows.Controls.Control.OnHold(Control ctrl, EventArgs e)
           at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

    Sometimes the app doesnt launch at all with message Item reorder is not supported when in Wrap Mode.

    but some other few times it just works as expected. Its rather strange behaviour, please advice.

    My XAML is simple as this:
    <telerikPrimitives:RadDataBoundListBox ItemTap="ListBoxItem_Tap" IsAsyncBalanceEnabled="True"
                                IsCheckModeEnabled="True" ItemsSource="{Binding Source}" ItemTemplate="{StaticResource ItemSTemplate}"
                                IsCheckModeActiveChanged="ListBox_IsCheckModeActiveChanged" ItemCheckedStateChanged="ListBox_ItemCheckedStateChanged">
                        <telerikPrimitives:RadDataBoundListBox.ItemReorderControlStyle>
                            <Style TargetType="telerikListBox:ItemReorderControl">
                                <Setter Property="ShiftUpButtonStyle" Value="{StaticResource ShiftUpButtonStyle}"/>
                                <Setter Property="ShiftDownButtonStyle" Value="{StaticResource ShiftDownButtonStyle}"/>
                            </Style>
                        </telerikPrimitives:RadDataBoundListBox.ItemReorderControlStyle>
                    </telerikPrimitives:RadDataBoundListBox>



    Thanks.
    Olu
  2. Deyan
    Admin
    Deyan avatar
    2038 posts

    Posted 25 Jun 2012 Link to this post

    Hi Olu,

    Thanks for writing.

    Based on the information that you are sharing I cannot exactly say why are you experiencing these issues. My guess is because you are using a custom style for the reorder control which does not provide all needed visual states and template parts but this is just a guess.

    Could you please provide us with a sample project that we can use to reproduce the exceptions so that we can directly see what goes wrong? Note that you will have to open a new support ticket in order to be able to attach your files.

    Thanks for your time.

    Kind regards,
    Deyan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Olu
    Olu avatar
    10 posts
    Member since:
    Dec 2010

    Posted 25 Jun 2012 Link to this post

    Hi,

    Thanks for your response.

    I copied the exact snip from the examples project and only changed the ItemsSource and ItemTemplate.
    Also, I'm using the exact style for the reorder control (ItemReorderControlStyle) as is in the examples project. As mentioned earlier, the reorder works fine some times but at random times will just give one of the error messages. The more common of the errors is "Element is already the child of another element." (I think I've found cause/solution for one of them).  Maybe I could try to see if I get the same issues in an isolated project.

    For the Item reorder is not supported when in Wrap Mode, I may have found the cause for it. From my investigation, if a DataBoundListBox is in say Pivot index 1, and on page load in Pivot index 0 you call listbox.IsItemReorderEnabled=True, it produces the error message Item reorder is not supported when in Wrap Mode I'm assuming because it has perhaps not drawn out the listbox yet. But if I make this call on Pivot index 1 after listbox has been laid out OR set IsItemReorderEnabled in the XAML then it works fine.

    Also is there a way to detect if the reorder window is open?
    And is there a way to drag+drop instead of arrow buttons?



  5. Deyan
    Admin
    Deyan avatar
    2038 posts

    Posted 25 Jun 2012 Link to this post

    Hi Olu,

    Thanks for getting back to us and for sharing this feedback.

    Since the Item Reorder feature is a new one, we really appreciate any feedback on it how we can improve it.

    Currently there is no way to understand whether the reorder popup is opened. We can consider extending the API of DataBoundListBox to allow the developer to subscribe for an event that fires when the popup is opened.

    As for the "Item reorder is not supported when in Wrap Mode" exception: normally it should be thrown in case you're trying to active the Item Reorder feature when the DataBoundListBox's VirtualizationStrategyDefinition is set to a WrapVirtualizationStrategyDefinition instance. If this is not the case on your side, sending us a project that reproduces it will be very helpful.

    The same applies for the other exceptions: a demo project will help us directly see what goes wrong.

    Thanks for your understanding and for the time taken.

    Greetings,
    Deyan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Alex
    Alex avatar
    21 posts
    Member since:
    Apr 2012

    Posted 24 Sep 2012 Link to this post

    Hello. 
    I've got the same System.InvalidOperationException.

    Message: Cannot resolve TargetName RootScale.
       at MS.Internal.XcpImports.VisualStateManager_GoToState(Control reference, String StateName, Boolean useTransitions, Boolean& refreshInheritanceContext)
       at System.Windows.VisualStateManager.GoToState(Control control, String stateName, Boolean useTransitions)
       at Telerik.Windows.Controls.RadDataBoundListBox.OnItemHold(RadDataBoundListBoxItem item, GestureEventArgs args)
       at Telerik.Windows.Controls.RadDataBoundListBoxItem.OnHold(GestureEventArgs e)
       at System.Windows.Controls.Control.OnHold(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

    It appears from time to time when I'm holding an item in the listbox in trying to set it in the reorder mode. With no reason. At least I do not see any reason.
  7. Deyan
    Admin
    Deyan avatar
    2038 posts

    Posted 25 Sep 2012 Link to this post

    Hello Alex,

    Thanks for writing.

    Any clues on how we can reproduce this issue? We are currently not able to reproduce it on our side and thus debugging it is not possible. If you manage to isolate it in a separate project and send it to us we will be able to take a look and see how we can help. Note that you will have to open a new support ticket in order to be able to attach a project.

    Thanks for your time.

    All the best,
    Deyan
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  8. Alex
    Alex avatar
    21 posts
    Member since:
    Apr 2012

    Posted 25 Sep 2012 Link to this post

    Hello, Deyan.

    I've realized that this kind of error appears when I added to the RadDataBoundListBox this code:
    telerik:InteractionEffectManager.IsInteractionEnabled="True"
     
    And also I enabled tilt effect for RadDataBoundListBoxItem:
    InteractionEffectManager.AllowedTypes.Add(typeof(RadDataBoundListBoxItem));

    I've attached a demo project that reproduces the issue: http://ompldr.org/vZm12ag
    Exception does not appear always. To see it you need to tap and hold different items in the listbox for some period of time.

    Additional question. I don't want to create a new thread for it. In my main project, where I saw this reordering exception for the first time, I also have an problem with up and down buttons in the item reordering mode. They haven't corresponding pictures with arrows (screenshot attached). In the demo project attached above all is good. And I can't reproduce this issue in the demo project. What can cause this?
  9. Deyan
    Admin
    Deyan avatar
    2038 posts

    Posted 27 Sep 2012 Link to this post

    Hello Olu,

    Thanks for writing.

    Please try setting the paths to the images for the reorder buttons via a style as shown below:

    <telerikPrimitives:RadDataBoundListBox.ItemReorderControlStyle>
        <Style TargetType="telerikListBox:ItemReorderControl">
            <Setter Property="ShiftUpButtonStyle">
                <Setter.Value>
                    <Style TargetType="telerikPrimitives:RadImageButton">
                        <Setter Property="Width" Value="54"/>
                        <Setter Property="Height" Value="54"/>
                        <Setter Property="BorderThickness" Value="3"/>
                        <Setter Property="Margin" Value="0, 0, 24, 24"/>
                        <Setter Property="ButtonShape" Value="Ellipse"/>
                        <Setter Property="RestStateImageSource" Value="/Telerik.Windows.Controls.Primitives;Component/DataBoundListBox/Images/ReorderButtonArrowDown.png"/>
                        <Setter Property="RenderTransformOrigin" Value="0.5, 0.5"/>
                    </Style>
                </Setter.Value>
            </Setter>
            <Setter Property="ShiftDownButtonStyle">
                <Setter.Value>
                    <Style TargetType="telerikPrimitives:RadImageButton">
                        <Setter Property="Width" Value="54"/>
                        <Setter Property="Height" Value="54"/>
                        <Setter Property="BorderThickness" Value="3"/>
                        <Setter Property="Margin" Value="0, 0, 24, 24"/>
                        <Setter Property="ButtonShape" Value="Ellipse"/>
                        <Setter Property="RestStateImageSource" Value="/Telerik.Windows.Controls.Primitives;Component/DataBoundListBox/Images/ReorderButtonArrowUp.png"/>
                        <Setter Property="RenderTransformOrigin" Value="0.5, 0.5"/>
                    </Style>
                </Setter.Value>
            </Setter>
        </Style>
    </telerikPrimitives:RadDataBoundListBox.ItemReorderControlStyle>


    Does this work for you?

    As for the InvalidOperationException - we have been able to reproduce it on our side by using your project. The reason for it is that the Tilt Effect resets the render transform used for the ItemReorder operartion. We have logged this issue in our TODO system. If you now wish to use the Item Reorder feature, you will have to turn off the Tilt effect applied on the list box items.

    I hope this helps.

    Let me know if you need further assistance here.

    Regards,
    Deyan
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  10. Tomas
    Tomas avatar
    3 posts
    Member since:
    Apr 2012

    Posted 16 Mar 2014 in reply to Deyan Link to this post

    Any progress on this? Latest version still causes the exception, removing the Titl effect works as a workaround
  11. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 20 Mar 2014 Link to this post

    Hello Tomas,

    This issue is not fixed yet. We will elevate its priority so that it is fixed for next release or internal build.
    Please excuse us for the inconvenience.

    Regards,
    Victor
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
Back to Top
DevCraft banner