4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 27 Oct 2009, 04:59 AM
Hi,
Attach OnDateSelecting event to RadCalendar and try the following client side code.
js:
-Shinu.
Attach OnDateSelecting event to RadCalendar and try the following client side code.
js:
<script type="text/javascript"> |
function OnDateSelecting(sender, args) { |
if (args._renderDay.IsSelected) { |
args.set_cancel(true); |
} |
} |
</script> |
-Shinu.
0
0
Samuel
Top achievements
Rank 1
answered on 07 Feb 2011, 09:24 PM
Does this solution still work?
When I try this script, it breaks the EnableMultiSelect="False"
In other words, multiple days can be selected despite multiselect being turned off.
I am using 2010.03.1109.40
When I try this script, it breaks the EnableMultiSelect="False"
In other words, multiple days can be selected despite multiselect being turned off.
I am using 2010.03.1109.40
0
Hi Samuel,
Best wishes,
Marin
the Telerik team
You can use the OnDateClick event to get the date that is about to be selected and then compare it with the current date. Here is a code sample:
var
date =
null
;
function
OnDateSelecting(sender, args) {
var
currentDate = args.get_renderDay().get_date();
var
newDate =
new
Date(currentDate[0], currentDate[1], currentDate[2]);
if
(args.get_renderDay().IsSelected && isDatesEquals(date,newDate)) {
args.set_cancel(
true
);
}
};
function
OnDateClick(sender, eventArgs)
{
var
d = eventArgs.get_renderDay().get_date();
date =
new
Date(d[0], d[1], d[2]);
}
function
isDatesEquals(date1, date2)
{
if
(date1.getFullYear() == date2.getFullYear() && date1.getMonth() == date2.getMonth() && date1.getDate() == date2.getDate())
{
return
true
;
}
else
return
false
;
}
Marin
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.