This is a migrated thread and some comments may be shown as answers.

Selection changed event

2 Answers 47 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 13 May 2010, 04:40 PM
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 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 14 May 2010, 02:39 PM
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.
0
Jon
Top achievements
Rank 1
answered on 18 May 2010, 02:46 PM
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
Tags
Calendar
Asked by
Jon
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Jon
Top achievements
Rank 1
Share this question
or