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


Top 5 Contributors of the Month
david stephan

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

scAutoCompletedgv.Clear();
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++)
{
scAutoCompletedgv.Add(dt.Rows[i]["productName"].ToString());
}
}

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

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

Hi,
http://www.codeproject.com/Questions/134644/How-to-add-large-number-of-Products-in-AutoComplet.aspx?display=Mobile

Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/


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
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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