I want to bind list of employees in drop down list , with autocomplete feature so the user can search the proper name .i use RadComboBox
I have two main problems :
1- The list is so large about 5000
item.so binding this large number of data in the browser make it hang or so slow.(performance issue)
According to the Telerik Documentation
Set a data source to the RadComboBox. Use either DataSourceID or the DataSource property to do this and set the DataTextField and DataValueField properties to the respective fields in the data source. (Note that when using DataSource you must set the property on each postback, most conveniently in Page_Init.) Set EnableAutomaticLoadOnDemand to true.
so i have to call the following method every time in Page_Init
!!!
protected void BindInnerInstructors()
{
ddl_inner_sup.Items.Clear();
ddl_inner_sup.DataSource = Utilities.GetAllInnerInstructors();
ddl_inner_sup.DataValueField = "emp_num";
ddl_inner_sup.DataTextField = "name";
ddl_inner_sup.DataBind();
}
2- Object reference not set to an instance of an object when trying to set the selection of a combo box.
i overcome this problem through this.
I have about 4
dropdowlists but every one have to bind in according to an event but i have to bind all of them in the page_init
.
I'll be grateful to a detailed answer to this problem .
my company had a similar issue. we ended up using a jquery object called Select2 and we lazy load the list. Basically we load only the first 10 or so at load time, making it fast to load, and if the user scrolls down past the first 10 we load the next 10 and so on. Select2 has a search feature which hits the server to return a custom list based on the search.
the problem with loading 5000 elements all at once is that the browser will take forever to load them, iterate through them, and manipulate them as needed. I am not saying "you must use select2" RadComboBox may have something like this you can use.
Good luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With