Hi all
I will try to explain you my problem (I'm french with bad engl
I have a datepicker wich, when date is selected, update other items (like button text...) So, I use OnSelectedDateChanged="RadDatePicker1_SelectedDateChanged"
In the js code I need to do 2 things :
1 - Check the css class for make an alert or not. Because, I have day-render function wich change css class of cell if the date is on a list like that :
protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
{
for (int i = 0; i < ListeDate.Count; i++)
{
string DateACompare = String.Format("{0:dd/MM/yyyy}", ListeDate[i]);
DateTime rdvDate = DateTime.ParseExact(DateACompare, "dd/MM/yyyy", null);
if (e.Day.Date == rdvDate)
{
//e.Cell.BackColor = Color.Red;
e.Cell.CssClass = "CasePrise";
}
}
}
If css class is not "CasePrise" I want make and alert
2 - Refresh my page for update other control with the date selected
So I do that, in js :
function RadDatePicker1_OnDateSelected(sender,args)
{
//Add JavaScript handler code here
//alert(sender.get_selectedDate());
__doPostBack('', '');
if ($(sender).hasClass("CasePrise"))
alert('Ok');
else
alert('Aucunes captures à la date selectionnée')
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
I have two problems : The first is that it don't check the cssclass
The second is that, when it do the postback, my day_render function don't work, so, the cell in my datepicker don't have different background color as it should
I hope my message will be understanding
Thanks for help