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

Reordering Issue

8 Answers 91 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dimitris
Top achievements
Rank 1
Dimitris asked on 26 Aug 2013, 10:08 PM
I'm using the re-ordering option in databound listbox but for a reason I don't get sometimes I get the following exception

{System.InvalidOperationException: 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.OnItemReorderPopup_OpenedChanged(Object sender, EventArgs e)
   at Telerik.Windows.Controls.RadWindow.OnWindowClosed(WindowCloseReason reason)
   at Telerik.Windows.Controls.RadWindow.Close(WindowCloseReason reason)
   at Telerik.Windows.Controls.RadWindow.RootVisualManipulationCompleted(Gesture gesture)
   at Telerik.Windows.Controls.GestureBehavior.OnManipulationCompleted(Object sender, ManipulationCompletedEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)}

after searching in the forums I found a similar topiv and someone said that it might be because of custom styles which in my case don't exist.
I have posted my code, as you can see I have included some controls from coding4fun toolkit  in the DataTemplate, do you think a conflict might occur or something? 

best regards
<telerikPrimitives:RadDataBoundListBox  x:Name="resultsLbox" Foreground="White" Tap="item_tapped" Grid.Row="1" Grid.ColumnSpan="2" Grid.RowSpan="2" ItemsSource="{Binding}" Margin="0,0,0,10" IsItemReorderEnabled="True" ItemReorderDownButtonTap="resultsLbox_ItemReorderDownButtonTap" ItemReorderUpButtonTap="resultsLbox_ItemReorderUpButtonTap" IsCheckModeEnabled="True" EmptyContent="">
                    <telerikPrimitives:RadDataBoundListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid Margin="5,0,0,0">
                                <StackPanel Margin="0,10,0,0" Orientation="Horizontal" >
                                    <Grid>
                                        <Image Height="160" Width="110" Source="/Assets/Images/noimage.png" />
                                        <Image Height="160" Width="110" Source="{Binding Poster}" />
                                    </Grid>
                                    <StackPanel>
                                        <TextBlock Margin="12,0,0,0" Text="{Binding Title}" Foreground="White" TextWrapping="Wrap" Width="250" />
                                        <toolkit:Rating  Margin="10,10,0,0" Background="Transparent" RatingItemCount="10" VerticalAlignment="Top" Height="23" ReadOnly="True" Value="{Binding Rating}" HorizontalAlignment="Left">
                                            <toolkit:Rating.FilledItemStyle>
                                                <Style TargetType="toolkit:RatingItem">
                                                    <Setter Property="Background" Value="White" />
                                                </Style>
                                            </toolkit:Rating.FilledItemStyle>
                                            <toolkit:Rating.UnfilledItemStyle>
                                                <Style TargetType="toolkit:RatingItem">
                                                    <Setter Property="Background" Value="Gray" />
                                                </Style>
                                            </toolkit:Rating.UnfilledItemStyle>
                                        </toolkit:Rating>
                                        <TextBlock  x:Name="yearTextBlock" Margin="13,10,0,0" Text="{Binding Year}" Foreground="White"/>
                                    </StackPanel>
                                </StackPanel>
                                <Grid HorizontalAlignment="Left" Background="#FF343D3F" Opacity="0.7" VerticalAlignment="Bottom">
                                    <TextBlock Margin="5,0,0,0" Foreground="White" VerticalAlignment="Bottom" FontSize="30" Text="{Binding Counter}" FontFamily="Segoe WP Black"></TextBlock>
                                </Grid>
                            </Grid>
                        </DataTemplate>
                    </telerikPrimitives:RadDataBoundListBox.ItemTemplate>
                </telerikPrimitives:RadDataBoundListBox>

8 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 27 Aug 2013, 08:01 AM
Hello Dimitris,

Thanks for writing.

Could you please check if removing the Coding4Fun component resolves the case so that we can make sure the issue is caused by it or not?

Thanks for your time.

Regards,
Deyan
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Dimitris
Top achievements
Rank 1
answered on 27 Aug 2013, 09:15 AM
Deyan, 

I have commented out the coding4fun code and the exception occurred again.
0
Deyan
Telerik team
answered on 27 Aug 2013, 02:16 PM
Hi Dimitris,

Thanks for writing back.

In this situation, sending us a sample project with the exact steps to reproduce the issue will be most helpful. We will thus be able to debug the code locally and see what exactly happens.

You will have to open a new support ticket in order to attach your sample.

Regards,
Deyan
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Dimitris
Top achievements
Rank 1
answered on 27 Aug 2013, 09:34 PM

P.S: I'm using the WP7 libraries and testing the app on a WP8 Emulator, what are the chances of this being the problem ?
0
Deyan
Telerik team
answered on 28 Aug 2013, 07:11 AM
Hello Dimitris,

Thanks for writing back.

Based on the stack trace at the point of the exception I see that there is an element missing in the control template which is used when a visual state is triggered. This might happen when you are using custom styles and have redefined the control template by omitting some of the vital parts of it. However, since you mentioned you are not using custom styles, it seems the issue comes from somewhere else. I cannot exactly say why it happens unless I can reproduce it on my side and thus be able to thoroughly debug it.

Regards,
Deyan
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Dave
Top achievements
Rank 1
answered on 01 Jan 2014, 11:58 PM

I too am having this problem. No custom controls, no custom styles. It happens at random. If I press-and-hold on some items in the list, the reorder control pops up normally and everything's fine. For other items, I get the above exception. There's no predictability, nor reproducibility. After restarting the app, the item that caused failure doesn't always cause failure again.


Something of possible interest: I've got the Telerik tilt effect applied to items in my list.



<DataTemplate x:Key="TemplateNoMenu">

<Border Width="{Binding MaxWidth, ElementName=.}" BorderThickness="0"

Background="{Binding Path=BorderBackground}" CornerRadius="5"

Margin="0,0,0,5"

telerikCore:InteractionEffectManager.IsInteractionEnabled="True">

<Grid>

 ... (various StackPanels and TextBlocks, etc) ...

</Grid>

</Border>

</DataTemplate>


<phone:PivotItem Header="by priority">

<telerikPrimitives:RadDataBoundListBox

IsItemReorderEnabled="True"

ItemReorderDownButtonTap="Reordered"

ItemReorderUpButtonTap="Reordered"

Name="RequestByPriorityList"

EmptyContent=""

ItemTemplate="{StaticResource TemplateNoMenu}" />

</phone:PivotItem>


using version 2013.3.1127.3040

0
Deyan
Telerik team
answered on 02 Jan 2014, 09:18 AM

Hello Dave,

Thanks for writing.



It is actually the Tilt effect causing this behavior. The reordering mode and the Tilt effect are currently incompatible. We are aware of this and have put it on our TODO list for fixing.



Our advice would be to turn off the Tilt effect for the time until we release a fix.



Let us know if you have additional questions.



Regards,

Deyan
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Ryan
Top achievements
Rank 1
answered on 07 Feb 2014, 07:44 PM
Thanks Deyan,

This problem has been bugging me for ages, glad to have a workaround.

Ryan
Tags
DataBoundListBox
Asked by
Dimitris
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Dimitris
Top achievements
Rank 1
Dave
Top achievements
Rank 1
Ryan
Top achievements
Rank 1
Share this question
or