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

Dynamically Created datePicker not Showing Calendar popups

5 Answers 96 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Hiren
Top achievements
Rank 1
Hiren asked on 01 Nov 2011, 03:38 PM
Hi,
i m creating multiple datePicker from Code behind and at run time itself i m adding the calendar control to same.But when I click on the datePicker it won't show me the calendar popup for the second instance that i have created.I have all these datePicker controls in dataList.

  RadDatePicker DatePicker = new RadDatePicker();
                        DatePicker.ViewStateMode = ViewStateMode.Enabled;
                        DatePicker.ID = "RadDatePicker_" + Field.AssessmentTemplateGroupId + "_" + Field.DBFieldName;
                        DatePicker.ClientIDMode = ClientIDMode.Static;
                        DatePicker.AutoPostBack = false;
                        
                        
                        DatePicker.Skin = "BariRC";
                        DatePicker.CssClass = "text";
                        DatePicker.EnableEmbeddedSkins = false;


                        RadCalendar calendar = new RadCalendar();
                        calendar.ID = "RadCalendar_" + Field.AssessmentTemplateGroupId + "_" + Field.DBFieldName;
                        calendar.UseColumnHeadersAsSelectors = false;
                        calendar.UseRowHeadersAsSelectors = false;
                        calendar.FastNavigationStep = 12;
                        calendar.EnableEmbeddedSkins = false;
                       
                        calendar.EnableMultiSelect = false;
                        
                        RadCalendarDay Day = new RadCalendarDay();
                        Day.Repeatable = RecurringEvents.Today;
                        calendar.SpecialDays.Add(Day);
                        DatePicker.Controls.Add(calendar);




                        RadDateInput dateInput = new RadDateInput();
                        dateInput.DateFormat = "MM/dd/yyyy";
                        dateInput.DisplayDateFormat = "MM/dd/yyyy";


                        DatePicker.Controls.Add(dateInput);


                        DatePicker.DatePopupButton.ImageUrl = "../../App_Themes/Bari_Default/images/calendar_ico.png";
                        DatePicker.DatePopupButton.HoverImageUrl = "../../App_Themes/Bari_Default/images/calendar_ico.png";
                        DateTime MinDate = new DateTime(1900, 01, 01);
                        DatePicker.MinDate = MinDate;

Thanks & regards
hiren

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 02 Nov 2011, 07:00 AM
Hello Hiren,

Most probably the issue comes because the image for the PopUp button is not referenced properly. So please make sure that the image is getting and set the url of the image correctly.

Thanks,
Princy.
0
Charles
Top achievements
Rank 1
answered on 25 Sep 2015, 11:44 AM
Hirin, I have the exact same issue. Did you ever figure out the workaround to this?
0
Viktor Tachev
Telerik team
answered on 29 Sep 2015, 02:33 PM
Hi Charles,

In the provided code the ClientIDMode of the controls is set to Static. Note that this mode is not supported for Telerik controls.  You can find additional information on the matter in the article below.


In order for the picker controls to work correctly the ClientIDMode should be set to AutoID or removed altogether.

Regards,
Viktor Tachev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Charles
Top achievements
Rank 1
answered on 29 Sep 2015, 03:37 PM
Thanks Viktor, that worked perfectly. In the interim, I had just used the popup on textbox focus, which had no issue with it being static.
0
Viktor Tachev
Telerik team
answered on 01 Oct 2015, 01:39 PM
Hello Charles,

I am glad that the issue was resolved. Note that the TextBox is a simple control. Thus, Static ClientIDMode could work for it.

However, the RadDatePicker is a composite control and requires the ClientIDMode to be set to AutoID.

Regards,
Viktor Tachev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Calendar
Asked by
Hiren
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Charles
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or