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

IndexOutOfRangeException when zero count given

1 Answer 19 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.
Jan
Top achievements
Rank 1
Jan asked on 23 Jul 2014, 02:27 PM
Hi,

im using DataBoundListBox with VirtualizingDataCollection like in this demo code:

XAML
<Controls:RadDataBoundListBox
            x:Name="listBox"
            DataVirtualizationMode="Automatic"
            Grid.Row="1"/>


CODE BEHIND
var col = new VirtualizingDataCollection(0, 10);
listBox.ItemsSource = col;

At first, DataBoundListBox is showing "no data to display" as it should. But when i try to scroll down in this empty list, it gives me IndexOutOfRangeException.

STACKTRACE
   at Telerik.Windows.Data.VirtualizingDataCollection.ProcessIndexesToLoadInAttachedMode(RadVirtualizingDataControl control)
   at Telerik.Windows.Data.VirtualizingDataCollection.MakeDataRequestIfNeeded(Int32 pivotIndex)
   at Telerik.Windows.Data.VirtualizingDataCollection.OnAttachedListBox_ScrollStateChanged(RadVirtualizingDataControl sender, ScrollState oldState, ScrollState newState)
   at Telerik.Windows.Controls.RadVirtualizingDataControl.OnScrollStateChanged(ScrollState oldState, ScrollState newState)
   at Telerik.Windows.Controls.RadDataBoundListBox.OnScrollStateChanged(ScrollState oldState, ScrollState newState)
   at Telerik.Windows.Controls.RadVirtualizingDataControl.SetScrollState(ScrollState newState)
   at Telerik.Windows.Controls.RadVirtualizingDataControl.OnScrollingStates_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)

Thanks for your help,

Jan

1 Answer, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 28 Jul 2014, 11:13 AM
Hi Jan,

Thank you for reporting this issue. We have managed to isolate this issue and we will address it in our next official release for WP8. The issue occurs only if the collection is empty if you do not assign ItemsSource or add ItemsSource with data it will work as expected. (In order to avoid this issue you can use cocepts used in this article - http://www.telerik.com/help/windows-phone/raddataboundlistbox-features-datavirtualization-automatic.html)
 

Regards,
Tsvyatko
Telerik

P.S. I have update your telerik points accordingly.
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
DataBoundListBox
Asked by
Jan
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Share this question
or