Product Bundles
DevCraft
All Telerik .NET and Kendo UI JavaScript components and AI Tools in one package.
Kendo UI
Bundle of AI Tools plus four JavaScript UI libraries built natively for jQuery, Angular, React and Vue.
Build JavaScript UI
Javascript
Telerik
Build modern .NET business apps
.Net Web
Cross-Platform
Desktop
Reporting and Documents
AI for Developers & IT
Ensure AI program success
AI for UI
AI Engineering
Additional Tools
Enhance the developer and designer experience
Testing & Mocking
Debugging
UI Tools
CMS
Free Tools
Support and Learning
Productivity and Design Tools
My combo is empty until I click the dropdown (items request event is fire): so what is the best strategy to set an initial item (value and text) in RadComboBox while using Loading on Demand?
Thx
<
telerik:RadComboBox
ID
=
"RadComboBox1"
runat
"server"
EnableLoadOnDemand
"True"
MarkFirstMatch
OnItemsRequested
"RadComboBox1_ItemsRequested"
>
</
protected
void
Page_Load(
object
sender, EventArgs e)
{
//adding initial RadComboBoxItem
if
(!Page.IsPostBack)
RadComboBoxItem item =
new
RadComboBoxItem();
item.Text =
"initial item"
;
item.Value =
"0"
RadComboBox1.Items.Add(item);
}
RadComboBox1_ItemsRequested(
o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
//Your code
<script type=
"text/javascript"
function
pageLoad() {
var
combo = $find(
"<%= RadComboBox1.ClientID %>"
);
comboItem =
Telerik.Web.UI.RadComboBoxItem();
comboItem.set_text(
"New Item"
combo.trackChanges();
combo.get_items().add(comboItem);
combo.commitChanges();
</script>