Chinmay
Posted on Jun 14, 2009
(permalink)
Hi I am Chinmay , i am using telerik Rad controls in my projects.
Problem : -
I have two fields in telerik radgrid. one is a readonly textbox with datetime value . other is a RadDateTimePicker.
Requirement - Whenever I change/select a date from RadDateTimePicker it should check whether the selecteddatetime is greater than the value present in the readonly textbox and popup a window with a simple message . All this we have to achieve through javascript and the validation should takes place as soon as we select a new value from RadDateTimePicker
I tried with SelectedDateChanged event of RadDateTimePicker but I am unable to access the javascript method attached to this event.
Can you please help me and if possible can you please post a sample code to achieve the requirement.
Thanks in advance.
Reply
Telerik Admin
Posted on Jun 14, 2009
(permalink)
Hello Chinmay,
Please test the following code-snippet and let me know whether it is suitable for your scenario:
Kind regards,
Daniel
the Telerik team
Reply
Chinmay
Posted on Jun 15, 2009
(permalink)
Thanks Daniel for the reply,
I think your approach is right.
Actually it's not readonly textbox it's a label .and i am not able to access the label value.
But for time being let it be a textbox ( present in RadGrid as I have mentioned in the first post )
It's giving a javascript error on this line - var tboxDate = new Date($get("TextBox1").value);
and I also tried with var tboxDate = new Date($get("<% = TextBox1.ClientId % >").value);
Still it's not working. I think as the textbox is in the RadGrid so there might be some other way to access it.
One more think the requirement is not to select the row also.
Today I tried some alternatives but still no results . I am finding it hard to use Rad Controls.
My requirement in simple terms , if that can help you understanding the requirement -
1 ) No row selection
2 ) On change of date it should get the textbox value (which contains a datetime value) which is present in the same row as the raddatetimepicker and should compare with the datetimepicker value and alert a message .
Let me know if you need more information .
Thanks in advance..
Reply
Answer
Telerik Admin
Posted on Jun 18, 2009
(permalink)
Hello Chinmay,
Thank you for the clarification. Please find attached a simple demo which I created for you.
Hope this helps.
Regards,
Daniel
the Telerik team
Reply