Dynamically Created datePicker not Showing Calendar popups

6 posts, 0 answers
  1. Hiren
    Hiren avatar
    62 posts
    Member since:
    Dec 2010

    Posted 01 Nov 2011 Link to this post

    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
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 02 Nov 2011 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Charles
    Charles avatar
    9 posts
    Member since:
    Aug 2015

    Posted 25 Sep 2015 Link to this post

    Hirin, I have the exact same issue. Did you ever figure out the workaround to this?
  5. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 29 Sep 2015 Link to this post

    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
  6. Charles
    Charles avatar
    9 posts
    Member since:
    Aug 2015

    Posted 29 Sep 2015 in reply to Viktor Tachev Link to this post

    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.
  7. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 01 Oct 2015 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017