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

DataRequested issuse

2 Answers 53 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.
Karol
Top achievements
Rank 1
Karol asked on 22 Apr 2013, 10:25 PM
Hello!
I found one strange behavior connected with RadDataBoundListBox (WP7). In my project I have bound ViewModel to the View (using MVVMLight). This listbox has set DataVirtualization to OnDemandAutomatic. The DataRequest event is send to VM via EventToCommand behavior. I found that this event is called even from the old instance of listbox (?).
Here is an example:
MainPage
ListBoxPage

here the navigation:
MainPage -> ListBoxPage -> back to MainPage -> go to ListBoxPage ...
and here I found that DataRequested event is fired from the new and old instances.
Some Logs from output:
ListBoxPage Constructor! 
Got Tag = 1
ListBoxPage Constructor! 
Got Tag = 1
Got Tag = 2
ListBoxPage Constructor! 
Got Tag = 3
Got Tag = 1
Got Tag = 2

Right now I solved it this way:
protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (e.NavigationMode == System.Windows.Navigation.NavigationMode.Back)
                FriendsList.DataVirtualizationMode = DataVirtualizationMode.None;
            base.OnNavigatedFrom(e);
        }

but this solution is not satisfying me. Any help will be appreciated.

Kind regards,
Karol

2 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 24 Apr 2013, 06:50 AM
Hi Karol,

This seems to be caused by the fact that DataBoundListBox instances are not garbage collected. This may happen because your static view models hold a reference to them and prevent the Garbage Collection from cleaning up the memory.

Can you please send us your project in a separate ticket so that we can take a look at it and see how we can help?

Kind regards,
Deyan
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Karol
Top achievements
Rank 1
answered on 24 Apr 2013, 10:04 AM
Sure in this week I will create the ticket with sample. 
Thanks for reply.

Kind regards,
Karol
Tags
DataBoundListBox
Asked by
Karol
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Karol
Top achievements
Rank 1
Share this question
or