XamlParseException Occured

11 posts, 1 answers
  1. Adam
    Adam avatar
    40 posts
    Member since:
    Dec 2011

    Posted 16 May 2012 Link to this post

    I'm getting the XamlParseException error when I try to add a RadListBox to my user control via XAML.Not a lot to the code here,

    <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
  2. George
    Admin
    George avatar
    1332 posts

    Posted 17 May 2012 Link to this post

    Hello Adam,

    Can you please give us some more details about which version of RadControls is used? Moreover, is this a Silverlight 4 or 5?

    Greetings,
    George
    the Telerik team

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

  3. DevCraft banner
  4. Adam
    Adam avatar
    40 posts
    Member since:
    Dec 2011

    Posted 17 May 2012 Link to this post

    Certainly,
    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
  5. Answer
    Georgi
    Admin
    Georgi avatar
    348 posts

    Posted 18 May 2012 Link to this post

    Hello 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 >>

  6. Adam
    Adam avatar
    40 posts
    Member since:
    Dec 2011

    Posted 18 May 2012 Link to this post

    Thanks Georgi.

    Adam
  7. Karen
    Karen avatar
    5 posts
    Member since:
    Jan 2015

    Posted 26 May 2015 in reply to Georgi Link to this post

    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? 

  8. Georgi
    Admin
    Georgi avatar
    348 posts

    Posted 27 May 2015 Link to this post

    Hello Karen,

    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
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  9. Karen
    Karen avatar
    5 posts
    Member since:
    Jan 2015

    Posted 27 May 2015 in reply to Georgi Link to this post

    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.

  10. Georgi
    Admin
    Georgi avatar
    348 posts

    Posted 28 May 2015 Link to this post

    Hello Karen,

    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,

    Georgi
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  11. Karen
    Karen avatar
    5 posts
    Member since:
    Jan 2015

    Posted 28 May 2015 in reply to Georgi Link to this post

    Thanks, Georgi, that was the problem. Shouldn't there be some type of warning on the "bad xaml" for that TargetType parameter?
  12. Georgi
    Admin
    Georgi avatar
    348 posts

    Posted 29 May 2015 Link to this post

    Hi Karen,

    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
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner