DataRequested issuse

3 posts, 0 answers
  1. Karol
    Karol avatar
    7 posts
    Member since:
    May 2012

    Posted 22 Apr 2013 Link to this post

    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. Deyan
    Admin
    Deyan avatar
    2038 posts

    Posted 24 Apr 2013 Link to this post

    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.
  3. DevCraft banner
  4. Karol
    Karol avatar
    7 posts
    Member since:
    May 2012

    Posted 24 Apr 2013 Link to this post

    Sure in this week I will create the ticket with sample. 
    Thanks for reply.

    Kind regards,
    Karol
Back to Top