I created radcombobox dynamically. I want to add EnableLoadOnDemand functionality from codebehind. I need a sample of code in asp.net having this functionality doing from codebehind.
SqlConnection con = newSqlConnection(ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ToString());
String s = "select FirstName,EmployeeID from Employees";
con.Open();
SqlDataAdapter dr = newSqlDataAdapter(s, con);
DataTable dt = newDataTable();
dr.Fill(dt);
con.Close();
rdcmb.DataSource = dt;
rdcmb.DataTextField = "FirstName";
rdcmb.DataValueField = "EmployeeID";
rdcmb.DataBind();
form1.Controls.Add(rdcmb);
}
Thanks,
Princy.
0
Ivana
Telerik team
answered on 16 Nov 2011, 11:36 AM
Hello Rukunuz,
To see how RadComboBox is bound to various data sources, you could refer to the DataBinding section of the Combo's online documentation.
To enable the load on demand functionality, you need to set the property LoadOnDemand to true, and subscribe to the OnItemsRequested server-side event, where the items will be populated when they are requested on demand (which happens when the user opens the drop-down list, or type in the input field), as in the code-block below:
More about load on demand mechanism, could be found at the following help article: RadComboBox: LoadOnDeman.
All the best,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now