raddateinput event server-side

0 Answers 59 Views
DateInput
RRE
Top achievements
Rank 2
Iron
RRE asked on 17 Mar 2023, 02:08 PM

I have to change the value of a raddateinput server side.

On client side I have an Ajax function than show the age.

What I have to use on server-side and on client-side to fie event?

For example this doesn't works:

server side:

RdMyDateInput.SelectedDate = DateTime.Parse(MyStringDate);

client side:

<telerik:RadDateInput ID="RdNyDateInput" runat="server" ClientEvents-OnValueChanged="AgeCount" Culture="it-IT" MaxDate="2999-12-31" MinDate="1900-01-01" Skin="Silk">
                 <ClientEvents OnValueChanged ="AgeCount"></ClientEvents>
</telerik:RadDateInput>

the event fires only on web page, not by server side.

Thanks

Renati

Attila Antal
Telerik team
commented on 22 Mar 2023, 10:35 AM

Hi Renati,

I am not sure I understand the question. Are you looking for the server-side event that triggers when the value changes or you are trying to make an AJAX request to set the value on the server?

RRE
Top achievements
Rank 2
Iron
commented on 27 Mar 2023, 08:32 AM

Dear Attila,

if user change value on page the component fire correctly the event.

I'm not able to do the same when I change the value from server side.

Probably I'm making something wrong. I will study it.

Thanks

Renato

Attila Antal
Telerik team
commented on 27 Mar 2023, 08:41 AM

Hi Renato,

The Code you showed us is the correct way to set a date for the DateInput.

RdMyDateInput.SelectedDate = DateTime.Parse(MyStringDate);

 

You just have to make sure that the "MyStringDate" returns a valid date format, so the Parse function will not throw an exception. Once you have a DateTime object, you can assign it to the SelectedDate property of the DateInput.

 

 

No answers yet. Maybe you can help?

Tags
DateInput
Asked by
RRE
Top achievements
Rank 2
Iron
Share this question
or