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

DatePicker Popup - highlight date

5 Answers 107 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
jgig
Top achievements
Rank 1
jgig asked on 15 Jan 2010, 09:43 PM
I have a RadDatePicker in a Repeater, when I enter a date in the first rows datepicker I take that date and add 5 days in the next rows calendar popup. I did this so it highlighted the date for you. (popup.selectDate(dateTriplet, true);)

The problem is when the user looks at that 2nd rows calendar popup, they see that date highlighted (which really means selected) and if that is the date they want they have to click it twice using the popup, once to unselect it and then to select it again.

Is there an way on the client to hightlight the date but not select it. I saw that you can add "special days" but that has to be done on the server side from what I understand.

thanks!

5 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 19 Jan 2010, 12:10 PM
Hello jgig,

In order to achieve your goal, you can try handling the RadCalendar DayRender client-side event and it is done here.
Another option is to try using the OnDateClick/OnDateSelected events for your purpose. There you can check if a date is already selected and cancel its deselection or set is as selected again.

Give it a try and let me know how it goes.

All the best,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
jgig
Top achievements
Rank 1
answered on 21 Jan 2010, 10:16 PM

I tried this and it displays fine but when I mouse over it the style changes and it never gets set back when you mouse off of it. I looked at this http://demos.telerik.com/aspnet-ajax/calendar/examples/programming/customdaycellrendering/defaultcs.aspx and it appears to work fine, not sure what I am doing differently. My calendar is loaded is modified during an ajax call also...not sure that has any impact.

protected void rcMultiMonth_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
{
if(Met Some Criteria){e.Cell.Style["border"] = "solid 1px #85c843";}
}

Any ideas?
0
Iana Tsolova
Telerik team
answered on 22 Jan 2010, 03:02 PM
Hi jgig,

Are you using RadAjax to ajaxify the problematic RadCalendar? If so, try replacing it with MS UpdatePanel and see if the issue persists.
Additionally, I suggest that you send me a sample page illustrating your scenario and setup. I will try debugging it locally and see what could have gone wrong there.

All the best,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
jgig
Top achievements
Rank 1
answered on 22 Jan 2010, 03:25 PM
you are right, I just changed it to an MS UpdatePanel and that fixed it. I have a pretty complex page that uses this multi month calendar like a date picker I saw below, so I can't keep it as a UpdatePanel:

How would I fix the RadAjax to work like an UpdatePanel for this? thanks!
0
Iana Tsolova
Telerik team
answered on 26 Jan 2010, 03:50 PM
Hi jgig,

I am afraid that  it is a known issue that styles applied on RadCalendar days in the DayRender event are lost after ajax request when the Calendar is ajaxified with RadAjax. We are searching for a resolution on this issue however still with no results.
In order the styles to be persisted in such case, you could try adding the styled days into the SpecialDays collection of the Calendar on Page_Load instead of styling the days on DayRender event.

Check it out and let me know if this works for you.

Sincerely yours,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Calendar
Asked by
jgig
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
jgig
Top achievements
Rank 1
Share this question
or