NullreferenceExcepting after changing VirtualizationStrategyDefinition

2 posts, 0 answers
  1. Victor
    Victor avatar
    25 posts
    Member since:
    May 2014

    Posted 21 Jul 2015 Link to this post


    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:   

    [ExceptionMessage]:[Object reference not set to an instance of an object.]
       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)]


    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?



  2. Rosy Topchiyska
    Rosy Topchiyska avatar
    547 posts

    Posted 24 Jul 2015 Link to this post

    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.

    Rosy Topchiyska
    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
  3. DevCraft banner
Back to Top