<telerik:RadListBox x:Name="lstTitle" Grid.Column="8" telerik:StyleManager.Theme="Transparent">
<telerik:RadListBoxItem Content="Test"/>
</telerik:RadListBox>
The exception is attached.
The regular ListBox works fine but the Telerik ListBox throws the error.
Also, I can add the RadListBox from code behind and I do NOT get the error.
Thoughts?
Thanks,
Adam
10 Answers, 1 is accepted
Can you please give us some more details about which version of RadControls is used? Moreover, is this a Silverlight 4 or 5?
George
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
We're running Silverlight 4. Telerik Controls version 2012.1.326.1040
It looks like the regular list box is going to work just fine but was curious about the error.
Thx
Adam
We were able to reproduce it with Silverlight 4 plugin. The issue is logged here in our Public Issue Tracking System. There you can track the progress of fixing it. Also your Telerik points have been updated for the report.
Greetings,
Georgi
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Adam
I am getting the same error with Silverlight 5 and the latest version of the UI for Silverlight. Your link to the Public Issue Tracking Forum no longer works. My list box has draggable items, and if I comment out the draganddrop portion of the xaml I don't get the error.
System.Windows.Markup.XamlParseException occurred
Message= [Line: 0 Position: 0]
LineNumber=0
LinePosition=0
StackTrace:
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
InnerException: System.Windows.Markup.XamlParseException
Message= [Line: 0 Position: 0]
LineNumber=0
LinePosition=0
StackTrace:
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, DependencyObject doh)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter)
at Telerik.Windows.Controls.ItemsControl.PrepareContentControl(Object item, ContentControl element)
at Telerik.Windows.Controls.ItemsControl.PrepareContainerForItemOverride(DependencyObject element, Object item)
at Telerik.Windows.Controls.Primitives.ListControl.PrepareContainerForItemOverride(DependencyObject element, Object item)
at System.Windows.Controls.ItemsControl.MS.Internal.Controls.IGeneratorHost.PrepareItemContainer(DependencyObject container, Object item)
at System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
at System.Windows.Controls.VirtualizingStackPanel.InsertContainer(Int32 childIndex, UIElement container, Boolean isRecycled)
at System.Windows.Controls.VirtualizingStackPanel.AddContainerFromGenerator(Int32 childIndex, UIElement child, Boolean newlyRealized)
at System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
InnerException:
Nothing is on the stack that I can debug without debugging into .Net internals. I do not want to post the code publicly, can I email it to you?
First of all we are sorry for the not working link as this is due to migration from the PITS system to the new Feedback portal. Also, please note that the initial issue was fixed in the Q2 2012 SP version of the controls and we are not able to reproduce it ever since.
So as this could be the same exception caused from the DragAndDrop for example and therefore we have tired several scenarios in order to reproduce it, but still no luck.
Nevertheless I am attaching my test project and it would be great if you can check it out and let me know if I am not missing something.
Also does this happens again only with static items (defined in xaml)?
Looking forward to your reply.
Regards,
Georgi
Telerik
Georgi,
Your listbox items don't have the capture drag/drop property set, mine do:
<Style x:Key="DraggableQAListBoxItem" TargetType="ListBoxItem">
<Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
</Style>
...
<telerik:RadListBox x:Name="QuickAlertsListBox" d:LayoutOverrides="GridBox" Foreground="{x:Null}"
ItemContainerStyle="{StaticResource DraggableQAListBoxItem}" AllowDrop="True"
ScrollViewer.VerticalScrollBarVisibility="Auto" Grid.Row="1" BorderBrush="{x:Null}"
Background="{StaticResource AppBackground}" Margin="0,0,0,0" Width="170" HorizontalAlignment="Left">
<drag:ListBoxDragDrop.Behavior>
<drag:ListBoxDragDropBehavior />
</drag:ListBoxDragDrop.Behavior>
That is a different type of drag and drop behavior, correct? This is legacy code, I didn't write it, but it used to work.
Please note, that you can find the setting of the AllowCapturedDrag in the RadListBox style located in the App.xaml file of the sent project.
So we have notice that probably(TargetType="ListBoxItem") you are using Microsoft ListBoxItem inside RadListBox and we recommend using the RadListBoxItem instead.
Also there are two different drag and drop behaviors:
- ListBoxDragDrop.Behavior - intended for providing drag and drop functionality via the Telerik DragAndDropManager for the Microsoft ListBox.
- RadListBox.DragDropBehavior - intended for providing drag and drop functionality via the Telerik DragAndDropManager for the RadListBox.
Therefore we recommend using the RadListBox with the RadListBox.DragDropBehavior as shown in this help article.
Hope this is helpful and if you have any other questions, please don't hesitate to contact us.
Regards,
Telerik
I am glad that we were able to locate the source of the issue. So usually the XamlParseException is indication of a "bad xaml", but nevertheless we will check if we can add some precautions for this scenario.
Thank you for the feedback and if you have any questions or ideas for improvements, please don't hesitate to write us.
Regards,
Georgi
Telerik