المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Fill Combobox with Large amount of Data



C# Programming
12-29-2012, 10:10 PM
i have more than 55000 Customer and i wanna Fill Combobox with this customers quick .. there is any way
to load form quickly and to enter Combobox quickly
** i use background worker but this hang my form and my app is run slowly can i use threading and how
i want solutin plz

private void backWork_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Cancelled) { } else { FillComboBox(); cmb3ameelname.Focus(); Loadform = true; cmb3ameelname.SelectedItem = null; cmbLandTele.SelectedItem = null; } } private void backWork_DoWork(object sender, DoWorkEventArgs e) { CusLis = CustomerManger.SelectCustomersAll(); } void FillComboBox() { cmbameelname.DataSource = CusLis; cmbameelname.DisplayMember = "CustName"; cmbameelname.ValueMember = "CustId"; } frm_load() { this.backWork.DoWork += new DoWorkEventHandler(this.backWork_DoWork); this.backWork.RunWorkerCompleted+=new RunWorkerCompletedEventHandler(this.backWork_RunWorkerCompleted); this.backWork.RunWorkerAsync(); }