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

DataBoundListBox seems don't works

3 Answers 39 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.
Paul
Top achievements
Rank 1
Paul asked on 04 Mar 2014, 08:09 AM
Hi I've  downloaded and install telerik Ui for Windows phone 8 (trial version), so I'm really interested into DataBoundListBox,
but I've try with this code and don't works as aspected,
I think that at the end of scroll  collection_ItemsLoading should be called, but after fill collection at the beginning nothing happen and event never raise anymore.


VirtualizingDataCollection collection = new VirtualizingDataCollection(30, 10);
public MainPage()
{
            InitializeComponent();

            radDataBoundListBox.DataVirtualizationMode = DataVirtualizationMode.Automatic;
            collection.ItemsLoading += new EventHandler<VirtualizingDataCollectionItemsLoadingEventArgs>(collection_ItemsLoading);
            radDataBoundListBox.ItemsSource = collection;

            
            
        }

        void collection_ItemsLoading(object sender, VirtualizingDataCollectionItemsLoadingEventArgs e)
        {
            
            collection.LoadItems(e.StartIndex, GetNext(e.Count));
        }

       

        int _item = 0;

        IEnumerable<string> GetNext(int n) {

            var l = new List<string>();
            for(var a=0;a<n;a++,_item++)
                l.Add("ITEM"+_item);

            return l as IEnumerable<string>;
        
}


thanks

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 04 Mar 2014, 10:04 AM
Hi Paul,

Thanks for writing.

Based on the source code you are pasting we cannot exactly say what happens. The VirtualizingDataCollection simply tracks which scroll position are you at and requests that all visible items are initialized for that scroll position. If your visual items are small enough that they all fit in the DataBoundListBox''viewport - they will all be loaded at once in the beginning and you will not receive any further ItemsLoading events.

Anyway, if you share with us your project in a separate support ticket we will be able to inspect your code and see how we can further assist you.

Regards,
Deyan
Telerik
If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
0
Paul
Top achievements
Rank 1
answered on 04 Mar 2014, 10:59 AM
Thanks for the answer,
my source is already here, only I left xaml part, a simple declaraction of a radDataBoundListBox, bytheway I understand that don't works as I understood..
To solve my problem I need  a listbox which display a list of items always constantly filled with 50 values, to achive this I should raise an event, when last item into listbox is displayed, but my list virtually never end because is costantly filled.
I thought DataBoundListBox did this :)

  
0
Deyan
Telerik team
answered on 04 Mar 2014, 12:55 PM
Hi Paul,

Then you may want to take a look at our Data Virtualization feature documented here:

http://www.telerik.com/help/windows-phone/raddataboundlistbox-features-datavirtualization-overview.html

There are several data virtualization modes which you can choose from. I think you should be looking at the OnDemand* features.

Let us know if you have additional questions.

Regards,
Deyan
Telerik
If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
Tags
DataBoundListBox
Asked by
Paul
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Paul
Top achievements
Rank 1
Share this question
or