This is a migrated thread and some comments may be shown as answers.

RadDatePicker issue when AutoPostBack is 'true'

1 Answer 102 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ketan
Top achievements
Rank 1
Ketan asked on 02 Jul 2013, 10:48 AM
Hi All,

I am facing an issue with Rad date picker.

I have a basic simple page with a RadDatePicker and another control(say a textbox). I want to show the textbox if I select any date from date picker. By default the text box is hidden. So, what I have done is, I wrote 'OnSelectedDateChanged' event of date picker and marked 'AutoPostBack' to true. Written the code to show the text box in 'OnSelectedDateChanged' event.
Something like; TextBox.Visible = !String.IsNullOrEmpty(DateRadDatePicker.SelectedDate.ToString());

Now, the issue is; when I'm viewing the page by default the selected date of date picker is blank. Now, I click on date picker to actually select some date. But as per standard behavior of rad date picker it selects today's date as default date on clicking the picker. So, today's date is populated in the text box of the date picker. Now, as I have written the date change event; it posts back and displays my text box because it gets selected date not blank(today's date). Up til now all is well. But the issue is; as the page is posted back, it closes the date picker again. Means, I have to again open the picker to select another date. Ideally it should remain open as I haven't manually selected any date; but just opened the picker to select some date(In a way it selected today's date, but still end user haven't selected the date).

This may be frustrating for end user. I want the default date to be selected as today's date when clicking the picker and also want the picker to be opened even after the date change event is fired.

Is there any solution for this??..

Thanks in advance..:)..

1 Answer, 1 is accepted

Sort by
0
Ketan
Top achievements
Rank 1
answered on 04 Jul 2013, 09:25 AM
Issue resolved..:)... JQuery helped me...
Tags
General Discussions
Asked by
Ketan
Top achievements
Rank 1
Answers by
Ketan
Top achievements
Rank 1
Share this question
or