DataBoundListBox Mango NullReferenceException

2 posts, 0 answers
  1. Bernhard König
    Bernhard König avatar
    78 posts
    Member since:
    Nov 2009

    Posted 18 Aug 2011 Link to this post

    Hi,

    I just downloaded the new Q3 Mango bits, replaced the references, and got the Exception below. Any ideas what can cause this or how to fix it? Are there any breaking changes for this control?

    If you need a sample solution please let me know and I will create a support ticket to attach my project.

    Edit: forgot to inclued, it's a NullReferenceException!

    Thanks,
    Bernhard

       at Telerik.Windows.Controls.RadVirtualizingDataControl.OnApplyTemplate()
       at Telerik.Windows.Controls.RadDataBoundListBox.OnApplyTemplate()
       at System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)
       at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
       at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
       at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
       at Microsoft.Phone.Controls.PivotItem.MeasureOverride(Size availableSize)
       at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)
       at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
       at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
       at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
       at Microsoft.Phone.Controls.Pivot.MeasureOverride(Size availableSize)
       at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)
       at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
       at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
       at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
       at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)
       at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
       at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
       at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
       at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)
  2. Bernhard König
    Bernhard König avatar
    78 posts
    Member since:
    Nov 2009

    Posted 18 Aug 2011 Link to this post

    Nevermind, found the reason.

    I used a custom template for the EmptyContentTemplate as the previous (NoDo) version of the control always centered the content and my templated stretched it.

    You have corrected this behaviour in this release - the content of the EmptyContentTemplate is now stretched by default. But most likely, this or some other changes to the control's template made my custom Template not work anymore and causing this exception. I removed the custom template, and now everything works as expected.

    That's why I don't like custom-templating controls and are happy that you have changed the default behaviour ;)

    thanks,
    Bernhard
  3. DevCraft banner
Back to Top