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

NullreferenceExcepting after changing VirtualizationStrategyDefinition

1 Answer 5 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.
Victor
Top achievements
Rank 1
Victor asked on 21 Jul 2015, 03:44 PM

 Hi,

I'm dynamically changing VirtualizationStrategyDefinition and after that all items is disappeared from the list. If I make pull-to-refresh the list sometime items are come back but sometimes I`ve got this error:   

[Type]:[NullReferenceException]
[ExceptionMessage]:[Object reference not set to an instance of an object.]
[StackTrace]:[
   at Telerik.Windows.Controls.RadDataBoundListBox.IsFirstItemFirstInListSource()
   at Telerik.Windows.Controls.RadVirtualizingDataControl.OnVerticalCompressionStates_StateChanging(Object sender, VisualStateChangedEventArgs 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)]
[InnerException]:[none]​

 

Im changing it in this way:

VirtualizationStrategyDefinition str = new WrapVirtualizationStrategyDefinition();
str.Orientation = System.Windows.Controls.Orientation.Horizontal;
radDataBoundListBox.VirtualizationStrategyDefinition = str;
radDataBoundListBox.ItemTemplate = (DataTemplate)((MainPage)sender).Resources["DataWarpTemplate1"];​​

Does anybody know how to fix this?

 

Victor

1 Answer, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 24 Jul 2015, 02:55 PM
Hi Victor,

Thank you for contacting us.

There seems to be a problem when you change the VirtualizationStrategyDefinition runtime. We will investigate the issue. Until a fix is available, as a workaround I can suggest to create a new DataBoundListBox each time the VirtualizationStrategyDefinition is changed.

Thank you for bringing this issue to our attention. I have updater your Telerik points accordingly.

Regards,
Rosy Topchiyska
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
Tags
DataBoundListBox
Asked by
Victor
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Share this question
or