方案一:利用控件本身所携带的触发事件实时加载指定条数的选项
<telerik:RadComboBox ID="radcbbx_SystemName" runat="server" Width="99%" Height="200px" HighlightTemplatedItems="true" EnableLoadOnDemand="true" Filter="None" AllowCustomText="True" CollapseDelay="1000" ExpandDelay="1000" onitemsrequested="radcbbx_SystemName_ItemsRequested" > <HeaderTemplate> <table style="width: 100%" cellspacing="0" cellpadding="0"> <tr> <td style="width: 100%;"> 系统名称 </td> </tr> </table> </HeaderTemplate> <ItemTemplate > <table style="width: 100%; height:20px;" cellspacing="0" cellpadding="0"> <tr> <td style="width: 100%;"> <%# DataBinder.Eval(Container, "Attributes[‘System_BaseName‘]")%> </td> </tr> </table> </ItemTemplate> </telerik:RadComboBox>
后台CS文件:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 |
protected
void radcbbx_SystemName_ItemsRequested( object
o, RadComboBoxItemsRequestedEventArgs e) { if
(e.Text != "" ) { DataTable dt = new
DataTable(); try { string
strWhere = " and System_BaseName like ‘%"
+ e.Text.Trim() + "%‘ " ; dt = sysbaseInfo.GetSystemBaseInfoIDandName(strWhere); foreach
(DataRow dataRow in
dt.Rows) { RadComboBoxItem item = new
RadComboBoxItem(); string
strName = dataRow[ "System_BaseName" ].ToString(); string
strId = dataRow[ "System_BaseID" ].ToString(); item.Text = strName.Trim(); item.Value = strId; item.Attributes.Add( "System_BaseName" , strName.Trim()); radcbbx_SystemName.Items.Add(item); item.DataBind(); } } catch
(Exception Ex) { SysLog sl = new
SysLog(); sl.WriteErrorLog( "0" , "获取立项申请页面关联系统列表失败!" , Ex); } finally { dt.Dispose(); } } } |
关于下拉列表数据过多导致IE10缓存溢出的解决方案,布布扣,bubuko.com
原文:http://www.cnblogs.com/jeforser/p/3628810.html