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 3800044
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:49:53+00:00 2026-05-19T13:49:53+00:00

I’m writing a simple dictionary app which gives suggestions for words as you type.

  • 0

I’m writing a simple dictionary app which gives suggestions for words as you type. The suggestions are displayed in a ListBox and each time the query changes, about 10 suggestions should appear.

Unfortunately, performance is low at the moment. It takes almost a second for the results to appear and I don’t understand why. EQATEC Profiler shows that my methods are running smoothly. I’ve confirmed this by putting a Stopwatch around my code. I’ve also experimented with the number of suggestions, and performance does increase with fewer items.

This leads me to conclude that rendering the ListBox (which I presume happens outside of my methods) is to blame for the lack of performance.

  • Does rendering 10 items in a ListBox really take more than 250ms?
  • How can I quickly put a small number of words on the screen?

Edit:
The way I fill my ListBox is very straightforward. Is it the right way?

resultsListBox.Items.Clear();
foreach (string s in suggestions.Words)
{
  resultsListBox.Items.Add(s);
}
resultsListBox.SelectedIndex = suggestions.MatchIndex;

What you see here is really it: default ListBox, String items, no templates. Do I violate one of these principals?

  • Ensure you have the item data template in a fixed sized container (grid).
  • Avoid/remove using complex converters, when the same information can be easily provided by the data object.
  • Avoid/remove nested structures, example listbox in a listbox item.
  • Strongly recommended to not use user control inside the data template.
  • Avoid/remove custom controls from the data template

The link below contains a demonstration of the ListBox performance in a simple project.

The project also shows an alternative (faster) way to display a list, using a Grid with Buttons. This list is not scrollable and therefore not a real solution.

http://www.mediafire.com/?jypcfm4cs3nvo5c

Remember to run the project on a device, because the emulator has very different performance. I’ve tested it on the Samsung Omnia 7.

  • 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-19T13:49:54+00:00Added an answer on May 19, 2026 at 1:49 pm

    It sounds like you’re creating your own AutoCompleteBox. Is there a specific reason for not using the one in the Toolkit?

    I would expect the time taken to update the listbox to be dependent upon: how you’re updating it; the complexity of the listbox; and whatever-else is on the page.
    In that you haven’t provided details about any of these it could be possible that it will take this long.


    Edit
    As an alternative to the AutoCompleteBox (In theory you shouldn’t need to scroll the results of this–just enter more characters to filter further.) I’ve done some experimentation and the following seems to work best. It uses a StackPanel inside a ScrollViewer and reuses the existing items, rather than creating new ones.

    <ScrollViewer Height="629" Margin="0,139,0,0" Width="480">
        <StackPanel Name="listBox1" />
    </ScrollViewer>
    

    cs:

        private void InitializeResultsGrid()
        {
            ...
    
            for (int i = 0; i < 26; i++)
            {
                ...
    
                listBox1.Children.Add(new TextBlock());
    

    and

    private void SlowFill(string baseStr)
    {
        for (int i = 0; i < buttons.Count; i++)
        {
            (listBox1.Children[i] as TextBlock).Text = baseStr + (char)(i + 'a');
        }
    

    When I timed it, it was slightly slower than using the Grid but the performace seemed fine to me on an LG-E900

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have just tried to save a simple *.rtf file with some websites and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.