Listbox with Virtualizing Data Collection throws Exception when changing count property

4 posts, 1 answers
  1. Mike
    Mike avatar
    39 posts
    Member since:
    May 2011

    Posted 08 Aug 2011 Link to this post

    Hi!
    i have a DataBoundListBox with a Virtualizing Data Collection, on initial Loading, everything works fine. But when i try to change the count property of the Virtualizing Data Collection to a vlaue lower then the old one, i get an IndexOutOfRangeException.

    Is this a bug?

    Here is the StackTrace:   at Telerik.Windows.Data.VirtualizingDataCollection.IsIndexLoaded(Int32 index)
       at Telerik.Windows.Data.VirtualizingDataCollection.GetItemAt(Int32 index)
       at Telerik.Windows.Data.VirtualizingDataCollection.get_Item(Int32 index)
       at Telerik.Windows.Data.RadListSource.RequestDataForItem(IDataSourceItem item)
       at Telerik.Windows.Data.DataSourceItem.get_Value()
       at Telerik.Windows.Data.RadListSource.RemoveItems(NotifyCollectionChangedEventArgs e)
       at Telerik.Windows.Data.RadListSource.SourceCollectionChangedOverride(NotifyCollectionChangedEventArgs e)
       at Telerik.Windows.Data.RadListSource.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
       at Telerik.Windows.Data.VirtualizingDataCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
       at Telerik.Windows.Data.VirtualizingDataCollection.OnCountChanged(Int32 oldCount, Int32 newCount)
       at Telerik.Windows.Data.VirtualizingDataCollection.set_Count(Int32 value)
       at SigiNxMobile.MainViewModel.service_CountCustomersCompleted(Object sender, CountCustomersCompletedEventArgs e)
       at SigiNxMobile.SigiNXServiceReference.SigiNXServiceClient.OnCountCustomersCompleted(Object state)
       at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
       at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
       at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
       at System.Delegate.DynamicInvokeOne(Object[] args)
       at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
       at System.Delegate.DynamicInvoke(Object[] args)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.Dispatch(DispatcherPriority priority)
       at System.Windows.Threading.Dispatcher.OnInvoke(Object context)
       at System.Windows.Hosting.CallbackCookie.Invoke(Object[] args)
       at System.Windows.Hosting.DelegateWrapper.InternalInvoke(Object[] args)
       at System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr pHandle, Int32 nParamCount, ScriptParam[] pParams, ScriptParam& pResult)

  2. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 08 Aug 2011 Link to this post

    Hello Michael,

    Thanks for writing and for reporting this issue.

    We are currently not aware of any issues in VirtualizingDataCollection and you are the first to report one. Since based on the stack trace we can only understand where the issue occured, but not how, we would kindly like to ask you to prepare a small Windows Phone 7 app that we can use to reproduce it and send it to us so that we can investigate.

    Please note that in order to be able to upload an app, you will have to open a new support ticket.

    Thanks for your time.

    We look forward to receiving the requested details.

    Regards,
    Deyan
    the Telerik team

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

  3. DevCraft banner
  4. Mike
    Mike avatar
    39 posts
    Member since:
    May 2011

    Posted 08 Aug 2011 Link to this post

    Thanks for your quick response, i just submitted the demo project in an new support ticket!
    looking forward for your answer!
  5. Answer
    Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 09 Aug 2011 Link to this post

    Hello Michael,

    Thanks for sending us your project.

    We have managed to reproduce the issue and will provide a fix for it in our next official release. In the meantime, you can use the following workaround:

    this.uxListBox.BeginUpdate();
    data.Count = 3;
    this.uxListBox.EndUpdate(true);

    Please refer to the support ticket you have opened for further details.

    Do not hesitate to get back to us in case you have further questions or need assistance.

    Regards,
    Deyan
    the Telerik team

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

Back to Top