Hi,
I have used a 2 RadDatepicker controls, one for start date and one for end date.
When End Date is less than start date, i am triggering an error message But the problem is once i come back from error message
EndDate would still have new Date which i picked.. How can i set it back to original Date ??
Ex: Start Date : 1/1/1999 End Date 1/1/2000
I will Modify Modify Start Date : 1/1/1999 End Date 1/1/1998
Now End Date should not be 1/1/1998 , it should be set back to 1/1/2000 on error.
below is code
<telerik:GridTemplateColumn HeaderText="Start" UniqueName="fispersrt" DataField="fispersrt"
Visible="true">
<ItemTemplate>
<telerik:RadDatePicker ID="rdDtStrtpkr" runat="server" SelectedDate='<%#Eval("fispersrt")%>'
Width="100%" CssClass="txtbx" onchange="javascript:return DirtyFlagUpdate()">
<ClientEvents OnDateSelected="OnDateSelected" />
</telerik:RadDatePicker>
</ItemTemplate>
</telerik:GridTemplateColumn
<telerik:GridTemplateColumn HeaderText="End" UniqueName="fisperend" DataField="fisperend"
Visible="true">
<ItemTemplate>
<telerik:RadDatePicker ID="rdDtEndpkr" runat="server" SelectedDate='<%#Eval("fisperend")%>'
Width="100%" CssClass="txtbx" onchange="javascript:return DirtyFlagUpdate()">
<ClientEvents OnDateSelected="OnDateSelected" />
</telerik:RadDatePicker>
</ItemTemplate>
</telerik:GridTemplateColumn>
function OnDateSelected(sender, e) {
if (e.get_newDate() < e.get_oldDate()) {
DisplayErrorMessage('ERRSA20404', 'Error');
}
}
Regards,
Akki