create a unique OnDateSelected client event for all instances

4 posts, 0 answers
  1. Attila Forczek
    Attila Forczek avatar
    1 posts
    Member since:
    Apr 2008

    Posted 05 Sep 2008 Link to this post


    I created an own DateCombo user control where I put a RadDatePicker control.
    I want to use more instances of this own user control  on one page and I want to handle unique OnDateSelected client event for all instances.
    I tried to use inline expression in the front code but as I experienced it was not resolved at the telerik:RadDatePicker (but in the javascript block it was)

    <script type="text/javascript">
            function OnDateSelected_<%= ClientID %>(sender, eventArgs)


     <telerik:RadDatePicker id="RadDatePicker1"
                              Width="100px"  CssClass="" >
                      <ClientEvents OnDateSelected="OnDateSelected_<%= RadDatePicker1.ClientID %>" />       
                  <Calendar EnableEmbeddedSkins="false" Skin="MySkin" runat="server">
                  <DateInput ID="radDateInput1" runat="server" EnableEmbeddedSkins="false" Skin="MySkin" DateFormat="d">
                  <DatePopupButton ImageUrl= "../Styles/telerik/Skins/MySkin/Calendar/datePickerPopup.gif" CssClass="DateInputImage"
                                   HoverImageUrl="../Styles/telerik/Skins/MySkin/Calendar/datePickerPopupHover.gif" />                                               

    Does anybody have any idea  how can I solve this problem?
    thx in advance

  2. Plamen Peshev
    Plamen Peshev avatar
    886 posts

    Posted 08 Sep 2008 Link to this post

    Hello Attila,

    We have addressed your question in the forum post you have opened on the same topic.

    Best wishes,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Mahtab
    Mahtab avatar
    4 posts
    Member since:
    Oct 2012

    Posted 08 Nov 2012 Link to this post

    Can you please mention the URL link of the solution for this question.
    I too facing the same issue and wanna get a solution urgently.

  4. Vasil
    Vasil avatar
    1604 posts

    Posted 12 Nov 2012 Link to this post

    Hello Mahtab,

    The solution is to set the event in the code behind:
    protected void Page_Load(object sender, EventArgs e)
        RadDatePicker1.ClientEvents.OnDateSelected = String.Format("OnDateSelected_{0}", RadDatePicker1.ClientID);

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top