Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4267286
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:52:43+00:00 2026-05-21T06:52:43+00:00

i have a long list selector in which i’m displaying data sorted by date.

  • 0

i have a long list selector in which i’m displaying data sorted by date.
The problem i’m facing is that the list loads successfully for the first time, but after coming back to the page containg the longlistselctor from the details page, the app is crashing with the following exception:

System.NullReferenceException was unhandled
Message=NullReferenceException
StackTrace:
at Microsoft.Phone.Controls.LongListSelector.Balance()
at Microsoft.Phone.Controls.LongListSelector.LongListSelector_LayoutUpdated(Object sender, EventArgs e)
at System.Windows.FrameworkElement.OnLayoutUpdated(Object sender, EventArgs e)
at MS.Internal.JoltHelper.RaiseEvent(IntPtr target, UInt32 eventId, IntPtr coreEventArgs, UInt32 eventArgsTypeIndex)

I’m not even able to trace because of what this is happening.
The list is populated as:


currentAudioList = DiaryDBController.DBController.GetDiaryRecordsWithAudio();

        var DiaryAudioRecordsByDate = from rec in currentAudioList
                                      group rec by rec.CreationDate into r
                                      orderby r.Key
                                      select new Group<DatabaseClasses.DiaryRecord>(r.Key, r);

        try
        {
            this.AudioGroupListSelector.ItemsSource = DiaryAudioRecordsByDate;
        }
        catch (Exception ex)
        {
            System.Diagnostics.Debug.WriteLine(ex);
        }

Any help will be appreciated.
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T06:52:44+00:00Added an answer on May 21, 2026 at 6:52 am

    I’ve had the same issue, it is reported here on Codeplex along with a possible workaround.

    It looks like the problem can be fixed by changing the first line of the LongListSelector.Balance() method from:

    if( !IsReady() || _flattenedItems.Count == 0 )
    

    to

    if( !IsReady() || _flattenedItems == null || _flattenedItems.Count == 0 )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a long list that of which a snippet looks something like this:
For classes that have a long list of setters that are used frequently, I
I have a text file that contains a long list of entries (one on
I have a long list of file names in a txt file, which I
I have a long list e2i, which maps rownames to values, and has duplicate
I have a long list of domain names which I need to generate some
I have a table that currently is a long list of devices and information
I have a long list of codes such as 008.45, etc that will need
I have a long list of items with date fields. Allowing jQuery to assign
I have a system that contains blobs of content and a very long list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.