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

Setting SelectedDate from AJAX causes icons to disappear

4 Answers 52 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 27 Apr 2009, 03:50 PM
Hi,

I'm trying to populate the content of a RadDateTimePicker from an AJAX call.  I've managed to get the control to show the new date however when I do the box of the control reverts to a standard .net control appearance and also the icons seem to show their alt text ("Open the calendar popup" and "Open the time view popup").  It seems as though the CSS gets screwed up when setting the value from the server,

I'm using a formview so have the following code in the codebehind:

DirectCast(uxFormView.FindControl("uxDate"), RadDateTimePicker).SelectedDate = Now() 

Note that if I use set_selectedDate from Javascript the date gets populated with no damage to the CSS.

Any ideas?

Regards,

Jon

4 Answers, 1 is accepted

Sort by
0
Jon
Top achievements
Rank 1
answered on 28 Apr 2009, 07:30 PM
Just in case anyone has a similar issue I found the solution.

I'd put the Theme = x that is in the PageInit into a If not callback and not postback.  As such when the control got re-rendered it didn't have the theme applied. 

In my opinion it's really odd that the control would be re-rendered when all that's happening is a value being set but I'm sure there is a good reason ;)

Hey Telerik guys,  can we have a Mark as Answer on our own posts?  I think it's good when people close off posts with the Answers and if we fix something ourselves it would be good to be able to mark our posts as such for the benefit of others....

Cheers

Jon
0
Sebastian
Telerik team
answered on 30 Apr 2009, 08:46 AM

Hello Jon,

I am glad that you discovered the reason for the issue you encountered and addressed it accordingly.

Unfortunately exposing 'Mark as answer' option for the community member who started the thread would not be a good practice since there might be some people who would take advantage of it (despite they do not provide an universal/cross-browser solution or descriptive explanation/fix at all).

In case the resolution posted in public forums is useful, this is acknowledged by the Telerik support staff posting a reply in the same thread and granting Telerik points for the involvement. This is commonly used practice and we assume it brings satisfactory results.

Best regards,

Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 1
answered on 30 Apr 2009, 09:04 AM
Hi Sebastian,

It's a shame that some people would abuse it (intentionally or not) as it is very useful to see the ticks when browsing the forums. 

Regards,

Jon
0
Sebastian
Telerik team
answered on 30 Apr 2009, 09:41 AM

Hello Jon,

It is indeed a shame but unfortunately this might happen occasionally (my assumption is based on my previous experience). I hope that you understand our position on this subject.

Best regards,

Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Calendar
Asked by
Jon
Top achievements
Rank 1
Answers by
Jon
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or