Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
6
Reply
Add items to the listbox in Windows Phone application
Sweta Sinha
Mar 3 2015 5:37 AM
802
Reply
Hi,
I have a listbox in xaml.I have to fetch a list of string from database and then have to display them in the listbox.The count of the items can be maximum 30,000.
I am fetching the data but when I am adding it in the listbox it crashes giving "Out of Memory Exception".
My Code:-
List<string> lstOfVals = Globals.dbHandler.getFullCache(s);
Dispatcher.BeginInvoke(() =>
{
listbox.Items.Clear();
foreach (string str in lstOfVals)
{
TextPhoneControl tpc = new TextPhoneControl ();
tpc.shorthandValue.Text = str;
listbox.Items.Add(tpc);
}
});
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
6
)
Next Recommended Forum
Search a string within a string
playing live stream in wp8 Web browser control