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

DataBoundListBox Mango NullReferenceException

1 Answer 45 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.
Bernhard König
Top achievements
Rank 2
Bernhard König asked on 18 Aug 2011, 04:36 PM
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)

1 Answer, 1 is accepted

Sort by
0
Bernhard König
Top achievements
Rank 2
answered on 18 Aug 2011, 05:39 PM
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
Tags
DataBoundListBox
Asked by
Bernhard König
Top achievements
Rank 2
Answers by
Bernhard König
Top achievements
Rank 2
Share this question
or