本文介绍了Telerik RadCombo控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在使用两个radcombobox和一个文本框来处理Telerik控件.一个组合框上的选择将填充另一个组合框,而第二个组合框的选择将填充文本框.该代码可以正常工作,但是在组合框中选择值时,页面将被加载.我想在没有页面加载的情况下完成相同的任务.请帮助...
这是我的客户端代码:
Hi All,
Am working on Telerik control with two radcomboboxes and a textbox. Selection on one combobox will fill another combobox and selection of second combobox will fill textbox. The code works fine but on selection of value in comboboxes, the page gets loaded. I want to accomplish the same task without page load.Pls help...
This is my clientside code:
<head id="Head1" runat="server">
<title></title>
<style type="text/css">
.#formComboFill {
width: 500px;
}
</style>
</script>
</head>
<body>
<form id="formComboFill" runat="server">
<div>
<table class="style1">
<tr>
<td>
<asp:Label ID="lblName" runat="server" Text="StoreName"> </td>
<td>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableScriptCombine="true">
<telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
<script type="text/javascript">
function LoadAddress(combo, eventarqs) {
var combo2 = $find("<%=cboSupplier.ClientID %>");
var name = combo2.get_value();
formComboFill.action = "Combo.aspx?action=loadAddrs&name=" + name;
formComboFill.submit();
}
</script>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function LoadcboSupplier(combo, eventarqs) {
var combo1 = $find("<%=cbocheck.ClientID %>");
var id = combo1.get_value();
formComboFill.action = "Combo.aspx?action=load&id=" + id;
formComboFill.submit();
}
</script>
<telerik:RadComboBox runat="server" ID="cboName" Filter="Contains" MarkFirstMatch="True"
EnableLoadOnDemand="True" AutoPostBack="false" önClientBlur="fnalert()" DataTextField="cStr_Name" DataValueField="iStr_id" DataSourceID="SqlDataSource1" >
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:KMCH_InventoryConnectionString %>"
SelectCommand="SELECT [iStr_id], [cStr_Name] FROM [Mast_Store]">
</td>
</tr>
<tr><td>
<asp:Label ID="lblSuplliers" runat="server" Text="Supplier Names">
</td>
<td>
<telerik:RadComboBox runat="server" ID="cboSupplier" Filter="Contains" MarkFirstMatch="True" OnClientSelectedIndexChanged= "LoadAddress"
EnableLoadOnDemand="True" ></td>
</tr>
<tr>
<td>
<asp:Label ID="lblAddress" runat="server" Text="">
</td>
<td>
<asp:TextBox ID="txtaddrs" Columns="10" Rows="10" runat="server"
TextMode="MultiLine" Width="163px" Height="200px">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
推荐答案
这篇关于Telerik RadCombo控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!