$find returns null for dynamically created RadComboBox in custom control in RadWindow

2 posts, 0 answers
  1. Trevor
    Trevor avatar
    4 posts
    Member since:
    Dec 2014

    Posted 09 Dec 2014 Link to this post

    We have a custom control we've created for lookups using RadComboBox.  The RadComboBox portion of the custom control is created dynamically in code.

    In our web page, we have a RadWindow, containing an instance of this custom control.  If you enter text in the RadComboBox, it pops up the RadComboBox's DropDownList.  If, while this DropDownList is displayed, you close or cancel out of the parent RadWindow, the RadComboBox's DropDownList remains displayed until the user clicks elsewhere on the page.

    I've read that to get around this, you would attach a BeforeClose or Close Client-side Event Handler to the RadWindow, with the following code.

    var control = $find("<%=RadComboBox.ClientID%>");

    However, $find() is always returning null.  I've even tried hard coding the ID of the RadComboBox into the $find method.  I thought I'd read somewhere that if you are creating telerik controls dynamically in this fashion, then $find will not work.  Is this true?  If so, what is the work around?

    I've tried variations of jQuery/javascript with show(), hide(), visibile = true/false without much luck.  The end result of those trials usually resulted in the DropDownList failing to return, or when it did, it displayed in a different part of the screen, or retained it's previous values after the RadWindow was closed/reopened.
  2. Peter Filipov
    Peter Filipov avatar
    1028 posts

    Posted 12 Dec 2014 Link to this post

    Hello Trevor,

    Could you please send me a sample which reproduces the described behavior. If the the RadComboBox ID is not set it will be generated automatically.

    Peter Filipov

    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