.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Forum >> Windows Application >> Post New QuestionBookmark and Share Subscribe to Forum

How to add large number of Products in AutoCompleteStringCollection

Posted By: Yatin     Posted Date: December 08, 2010    Points:2   Category :Windows Application
In My project i have a gridview into which i m showing productdetails.For Getting Details firstly i have to select a product.So in the first cell of row i type the alphabets to get the products.To get products in the cell as a list i am
using AutoCompleteStringCollection.On page load i filling this AutoCompleteStringCollection

string StrSel ="";
if (SelectedCompany.Count == 0)
StrSel = "select productname from products order by productname";

DataTable dt = new DataTable();
dt = ObjSql.Select(StrSel);
if (dt != null && dt.Rows.Count > 0)
for (int i = 0; i < dt.Rows.Count; i++)

and i m using this on datagrid views EditingControlShowing event like bellow

//Because of this Code I am getiing ProductNames as a dropdown list in the cell of DataGridView
if (gvProduct.CurrentCellAddress.X == 0)
TextBox txt = e.Control as TextBox;
txt.AutoCompleteCustomSource = scAutoCompletedgv;
txt.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
txt.AutoCompleteSource = AutoCompleteSource.CustomSource;
by this code i am getting a list of product name in the first cell of datagrid view like a dropdownlist
But as there are more than 20000 products,adding products in AutoCompleteStringCollection takes so much time and my application gets Hang at that time...Is there any way to attach so many product within very short time
Pls Help

Author: Narayanan             
Posted Date: December 14, 2011     Points: 20   


Regards, Lakshmi Naraayanan.S

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend