Selection changed event

3 posts, 0 answers
  1. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 13 May 2010 Link to this post

    Hi All,

    I am dynamically creating a load of datetime controls (code below) and they all use a shared calendar and timeview to save resources.  They work fine except for the fact that I can't figure out how to get an AJAX callback to fire on the SelectedDateChanged event.  If I create a control in the aspx file it's fine however creating dynamically is another matter.  Other than using a JS based callback does anyone have any thoughts?

    Dim uxStartDate As RadDateTimePicker = New RadDateTimePicker  
    uxStartDate.DbSelectedDate = CDate(startDate)  
    uxStartDate.ID = "uxStartDate_" & rowID  
    uxStartDate.Width = 180  
    uxStartDate.CssClass = "dateCol" 
    uxStartDate.SharedCalendarID = "uxSharedCal" 
    uxStartDate.SharedTimeViewID = "uxSharedTimeView" 
    uxStartDate.DateInput.DisplayDateFormat = "ddd dd/MM/yy HH:mm:ss" 
    uxStartDate.AutoPostBack = True 
    uxStartDate.AutoPostBackControl = Telerik.Web.UI.Calendar.AutoPostBackControl.Both  
     
     
     
    Protected Sub SelectedDateChange(ByVal sender As ObjectByVal e As Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs)  
      ' Do some stuff here  
    End Sub 

    I am also finding that when I add the control to the Ajaxmanager as below the calendar is displayed at the bottom of the page and non of my controls get displayed, any thoughts?

    uxRadAjaxManager.AjaxSettings.AddAjaxSetting(uxStartDate , uxEndDate) 


    Regards,

    Jon
  2. Radoslav
    Admin
    Radoslav avatar
    1566 posts

    Posted 14 May 2010 Link to this post

    Hi Jon,

    Could you please try to attach the event handler to the RadDateTimePicker control, with the following code snippet and let me know if the issue still persists:
    AddHandler uxStartDate.SelectedDateChanged, AddressOf SelectedDateChange

    Additionally I am sending you a simple example which demonstrates how to achieve the desired functionality. Please check it out and let me know if it helps you.

    Sincerely yours,
    Radoslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 18 May 2010 Link to this post

    Hi Radoslav,

    Many thanks for that.  I ended up doing a work around on my original problem however I am interested in getting this going as I think that I'll be able to make the whole thing work better with this option.

    Thanks for the example however it's not too applicable for me as I'm doing my own custom grid for this as I don't get any benefits from the RadGrid in this case and if anything it means more work arounds.

    The AddHandler code did work however I need to look at my page as the objects all got lost on the callback - think I need to read up on object instantiation ;)

    Best Regards,

    Jon
Back to Top