My intent is to update the second RadComboBox from the xmldatasource but I foudn the Databind() call wasnt working. I commented out that code and tried a simpler population approach (in case theres a problem with my Xpath to the xmldatasource) but its still not working. I have seen references in the forum to needing to set these properties in the RadComboBox
RegisterWithScriptManager="false"
EnableClientScriptEvaluation="true"
but it hasnt succeeded. What mistake am I making?
Also, why isnt the source code for the webservices files provided with the examples on using webservice with RadXmlHttpPanel?
I couldnt find an example which showed the webservice method required to populate a RadComboBox using RadXmlHttpPanel.
Thanks for any assistance
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AjaxCombo.aspx.cs" Inherits="AjaxCombo" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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 id="Head1" runat="server">
<title>Untitled Page</title>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function SetValue(combo, args)
{
var value = combo.get_value();
var panel = $find("<%=RadXmlHttpPanel1.ClientID %>");
panel.set_value(value);
}
</script>
</telerik:RadScriptBlock>
<style type="text/css">
.combobox-panel
{
width: 750px;
height: 64px;
background: transparent url( 'Images/backgrounds/div_rounded.png' ) no-repeat 0 0;
margin-bottom: 30px;
text-align: center;
}
.combobox-panel .RadComboBox
{
margin-top: 20px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<div class="combobox-panel">
<telerik:RadComboBox ID="RadComboBox1" runat="server" Width="289px" Height="200px"
DataSourceID="XmlDataSource1" DataValueField="ID" DataTextField="name" EmptyMessage="Choose a council..."
OnClientSelectedIndexChanged="SetValue">
</telerik:RadComboBox>
</div>
<telerik:RadXmlHttpPanel ID="RadXmlHttpPanel1" runat="server" OnServiceRequest="RadXmlHttpPanel1_ServiceRequest">
<div class="combobox-panel">
<telerik:RadComboBox ID="RadComboBox2" runat="server" Width="289px" Height="200px"
EmptyMessage="Choose a plan..." Visible="False">
</telerik:RadComboBox>
</div>
</telerik:RadXmlHttpPanel>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="App_Data/ClientData.xml"
XPath="clients/client/documents/document" />
<asp:XmlDataSource ID="XmlDataSource2" runat="server" DataFile="App_Data/ClientData.xml" />
</form>
</body>
</html>
protected void RadXmlHttpPanel1_ServiceRequest(object sender, Telerik.Web.UI.RadXmlHttpPanelEventArgs e)
{
//XmlDataSource2.XPath = "clients/client[@ID='" + e.Value + "']/documents/document";
//RadComboBox2.DataSourceID = XmlDataSource2.ID;
//RadComboBox2.DataBind();
//RadComboBox2.Visible = true;
ArrayList itemsList = new ArrayList();
itemsList.Add("Beverages");
itemsList.Add("Condiments");
itemsList.Add("Confections");
RadComboBox2.DataSource = itemsList;
RadComboBox2.DataBind();
RadComboBox2.Visible = true;
}