An usercontrol with Radcombobox and RadWindo

2 posts, 0 answers
  1. Kalyani
    Kalyani avatar
    20 posts
    Member since:
    Jul 2011

    Posted 07 Oct 2014 Link to this post


    I am hoping someone can help me with my code.  I have an user control which contains a single RadCombobox.  This is the code.

     HighlightTemplatedItems="true"  >
     <div onclick="StopPropagation(event)" >                                   
      <asp:CheckBox ID="ComboCheckBox" runat="server" CssClass="formTextElevenPx" style="vertical-align: middle;" />
      <span id="CheckBoxLabel" runat="server"><%# DataBinder.Eval(Container, "Text")%></span>

    I use some Javascript in this page and in my page_prerender event I call the javascript.

    <script type="text/javascript">
    function StopPropagation(e) {
      //cancel bubbling
      e.cancelBubble = true;
      if (e.stopPropagation) {
     function onCheckBoxClick_<% =uniqueKey %>() {
      var combo = $find("<%= InternalComboBox.ClientID %>");
     function UpdateMessage(combo) {  
      var items = combo.get_items();
      var text = "";
      for (var i = 1; i < items.get_count(); i++) {
       var item = items.getItem(i);
       var chk1 = $get(combo.get_id() + '_i' + i + '_ComboCheckBox');
       if (chk1.checked)
        text+= item.get_text() + ", ";
      return text.trim();

    I call this Javascript in the onclick event of the RadComboCheckbox like this -
    protected string uniqueKey;
     protected void Page_PreRender(object sender, EventArgs e)
      this.uniqueKey = Guid.NewGuid().ToString("N");
      foreach (RadComboBoxItem i in InternalComboBox.Items)
       CheckBox cbx = i.FindControl("ComboCheckBox") as CheckBox;
       if (cbx != null)
        cbx.Attributes["onclick"] = "return onCheckBoxClick_" + uniqueKey + "()";

    So I call the javascript in the cbx.Attributes["onclick"] event.  

    This user control when placed in a normal page works without any issues.  But when I place the usercontrol inside a Radwindow then the javascript associated with the usercontrol -onCheckBoxClick will not load and it shows an Reference not found javascript error.  Why does this happen and how would I fix it.  Would appreciate any help you can provide me.

  2. Boyan Dimitrov
    Boyan Dimitrov avatar
    2062 posts

    Posted 10 Oct 2014 Link to this post


    I am afraid that I am not able to replicate such issue. Could you please send us a sample page that replicates the issue? This way we can investigate it thoroughly and find the problem.

    Boyan Dimitrov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top