Hello, theres,
I use combobox to show about 3000 items, the performance is bad. Any idea?
my code default.aspx.cs follows
my default.aspx follows
about 8 seconds for 2999 items in IE 8, but seems ok in Chrome. How to solve the problem ?
Regards,
Agi
I use combobox to show about 3000 items, the performance is bad. Any idea?
my code default.aspx.cs follows
using
System;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Data;
using
System.Configuration;
using
System.Web.Security;
using
System.Web.UI.WebControls.WebParts;
using
System.Web.UI.HtmlControls;
using
Telerik.Web.UI;
public
partial
class
Default : System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
}
protected
void
Customer_ItemsRequested(
object
o, RadComboBoxItemsRequestedEventArgs e)
{
for
(
int
i = 0; i < 3000; i++)
{
Customer.Items.Add(
new
RadComboBoxItem(
"item "
+ i,
"1"
));
}
}
}
my default.aspx follows
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
telerik:RadStyleSheetManager
id
=
"RadStyleSheetManager1"
runat
=
"server"
/>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
<
Scripts
>
<%--Needed for JavaScript IntelliSense in VS2010--%>
<%--For VS2008 replace RadScriptManager with ScriptManager--%>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/>
</
Scripts
>
</
telerik:RadScriptManager
>
<
script
type
=
"text/javascript"
>
//Put your JavaScript code here.
function LoadCustomer(sender, eventArgs) {
var CustomerCombo = $find("<%=Customer.ClientID%>");
CustomerCombo.clearSelection();
CustomerCombo.requestItems("", false);
}
</
script
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
</
telerik:RadAjaxManager
>
<
div
>
<
telerik:RadComboBox
ID
=
"SalesList"
Runat
=
"server"
onclientselectedindexchanging
=
"LoadCustomer"
>
<
Items
>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"RadComboBoxItem1"
Value
=
"RadComboBoxItem1"
/>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"RadComboBoxItem2"
Value
=
"RadComboBoxItem2"
/>
</
Items
>
</
telerik:RadComboBox
>
<
telerik:RadComboBox
ID
=
"Customer"
runat
=
"server"
onitemsrequested
=
"Customer_ItemsRequested"
>
</
telerik:RadComboBox
>
</
div
>
</
form
>
</
body
>
</
html
>
about 8 seconds for 2999 items in IE 8, but seems ok in Chrome. How to solve the problem ?
Regards,
Agi