Click here to Skip to main content
15,898,134 members
Articles / Desktop Programming / WPF

Loading huge data in a Silverlight AutoCompleteBox

Rate me:
Please Sign up or sign in to vote.
4.78/5 (7 votes)
9 Aug 2011CPOL3 min read 55.8K   1.5K   18  
Creating a custom AutoCompleteBox which will filter large amounts of data quickly.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AutoCompeteBoxSample
{
    public partial class About : Page
    {
        public About()
        {
            InitializeComponent();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            IList<string> sourceList = new List<string>();

            for (int i = 0; i < 200000; i++)
            {
                sourceList.Add("Item-" + i);
            }

            this.acbFastLoading.FastLoadingACBItemsSource = sourceList;
        }

        private void acbFastLoading_FastLoadingACBSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //System.Windows.MessageBox.Show("Added Item is : "+e.AddedItems[0].ToString());
        }

       
       
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) CA-CIB
Singapore Singapore
I am a .Net developer, currently working in Singapore worked wiith Societe Generale Global Solution Centre, Bangalore and was previously with Cognizant.I have more than 8 years of .Net experience in BFSI domain. I am an experienced developer in C#, VB.Net, Silverlight, WPF, WCF, LINQ, Entity Framework, SSIS, NHibernate, ASP.Net and SQL Server.

Comments and Discussions