
| <DefaultGroupSettings OffsetX="-10" OffsetY="-5" /> |
I have a Combo Box which I am trying to use to drop down a CheckBoxList control, which the user can make multiple selections. I have an onclick event on each of the checkboxes, and in that event handler I am trying to get a reference to the checkboxlist. In the code behind, I attach the event handler by doing
checkbox.Attributes.Add(
"onclick", "doPropertyClick()")
for each checkbox. In the handler, I am trying to get a reference to the checkbox list below, but I do not know how to find the checkbox control within the template item on the client side.
function doPropertyClick() {
var count = 0
var txt = ""
var combo = $find("ddlProperties")
var cbxList = combo.get_items().getItem(0)
var arrayOfCheckBoxes = cbxList.childNodes
for(var i=0;i<arrayOfCheckBoxes.length;i++) {
count = count + 1
txt = arrayOfCheckBoxes[i].text
}
if (count > 1) {
txt =
"Multiple Selected"
}
setTimeout(
function() { $find("ddlProperties").set_text(txt); }, 100);
}
The declaration for the control is below.
<
telerik:RadComboBox ID="ddlProperties" runat="server">
<ItemTemplate>
<asp:CheckBoxList ID="cbxProperties" runat="server" RepeatLayout="Flow">
</asp:CheckBoxList>
</ItemTemplate>
<Items>
<telerik:RadComboBoxItem />
</Items>
</telerik:RadComboBox>
| <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Skin="Mac" Height="100%" ExpandMode="FullExpandedItem" |
| OnItemDataBound="RadPanelBar1_OnItemDataBound"> |
| </telerik:RadPanelBar> |
| <asp:XmlDataSource ID="xdsSummary" runat="server" XPath="Summaries/Items/Summary" EnableCaching="false" /> |
| this.xdsSummary.DataFile = "http://mywebservice/myService.asmx/GetSummaryContainer?acct=1234"; |
| RadPanelBar1.DataSource = this.xdsSummary; |
| RadPanelBar1.DataBind(); |
| <?xml version="1.0" encoding="utf-8" ?> |
| - <Summaries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
| - <Items> |
| - <Summary> |
| <Title>Title 1</Title> |
| </Summary> |
| - <Summary> |
| <Title>Title 2</Title> |
| </Summary>- |
| </Items> |
| </Summaries> |
| protected void RadPanelBar1_OnItemDataBound(object sender, Telerik.Web.UI.RadPanelBarEventArgs e) |
| { |
| System.Xml.XmlElement xmlElement = e.Item.DataItem as System.Xml.XmlElement; |
| foreach (System.Xml.XmlNode node in xmlElement.ChildNodes) |
| { |
| if (node.Name == "Title") |
| e.Item.Text = node.InnerText; |
| } |
| } |
| <?xml version="1.0" encoding="utf-8" ?> |
| <string><div id="WidgetContent"> <script type="text/javascript"> //<![CDATA[ Sys.WebForms.PageRequestManager._initialize('ctl02$ScriptManager1', document.getElementById('ctl01')); Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90); //]]> </script> <div> <table cellspacing="0" border="0" id="ctl02_DetailsView1" style="border-collapse:collapse;"> <tr> <td colspan="2"><b>Account Type:</b></td><td></td> </tr></table> </div> </div> <script type="text/javascript"> //<![CDATA[ Sys.Application.initialize(); //]]> </script></string> |