master/content/repeater/usercontrol/RadDataPicker minimum requirements

3 posts, 0 answers
  1. Scott
    Scott avatar
    28 posts
    Member since:
    May 2015

    Posted 18 May 2015 Link to this post

    Hello, I'm on a telerik trial.

    I need to get the RadDataPicker working in a custom control that is placed in a repeater in a content page.

    So far what I get is a textbox for the date and the date "button" is a text link: "Open the Calendar Popup".  Clicking the link does nothing.  Click in the date box also does nothing (no calendar-date-picker pops up).

    Right now all I care about is getting the minimal default behavior for this control within this context.  I'm assuming I do not quite have correct usage of RadScriptManager (&ScriptManagerProxy) and/or RadAjaxManager (&RadAjaxManagerProxy) and/or some other missing element along those lines.

    I would be very happy to know the absolute minimum that would normally be needed to get a basic RadDatePicker control working in this context, assuming there are no mystery conflicts to be dealt with.

    Put _____??_______ in the master page (if anything)?

    Put _____??_______ in the content page (if anything)?

    Put _____??_______ in the repeater item template (if anything)?

    Put _____??_______ in the customer control.?

  2. Scott
    Scott avatar
    28 posts
    Member since:
    May 2015

    Posted 18 May 2015 in reply to Scott Link to this post

     I was able to get this working -- but I am perplexed at why what I did made a difference.

     I have this on the content page:

    <telerik:RadScriptManager ID="RadScriptFoo" runat="server" />
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelFoo" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxFoo" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="datepickerDivC">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="datepickerDivC"  LoadingPanelID="RadAjaxLoadingPanelFoo">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
     
    <div id="datepickerDivC" style="visibility: hidden; height: 0px">
        <telerik:RadDatePicker ID="RadDateFoo" runat="server"></telerik:RadDatePicker>
    </div>

    And I have this in the customer control:

    <telerik:RadDatePicker ID="RadDateFoo2" runat="server"  Width="100"
        ShowPopupOnFocus="True"
        MinDate="01/01/2015"
        MaxDate="01/01/2016"
        DatePopupButton-Visible="True"
        EnableScreenBoundaryDetection="True"
        ShowAnimation-Type="Slide"
        HideAnimation-Type="Slide" />

     And everything works.

    But it does not work if I delete the RadDatePicker (which I have even hidden!) control from the content page.  Note that on the content page, I use a different ID for the RadDatePicker and the RadAjaxManager does not reference any ids that are used in the custom control:

    <div id="datepickerDivC" style="visibility: hidden; height: 0px">
        <telerik:RadDatePicker ID="RadDateFoo" runat="server"></telerik:RadDatePicker>
    </div>

    I only discovered that as I was experimenting to make sure I could get a RadDatePicker working outside the the repeater/custom control.  When I did, suddenly the RadDatePicker controls within the custom control in the repeater were also working correctly!

    Seems to me that it should not matter whether an unrelated RadDatePicker control exists on the page outside of the repeater/custom control, but apparently it does.

    Why?

    Is there something I need to do within the custom control and/or the repeater item template such that the above rather odd workaround is not necessary?

    I have tried the following within the customer control, but its presence or absence makes no difference:

    <asp:ScriptManagerProxy ID="scriptFoo" runat="server"></asp:ScriptManagerProxy>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManagerProxy ID="ajaxFooProxy" runat="server">
                <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="datepickerDiv">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="datepickerDiv" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

    Note that I put the RadDatePicker inside a <div>:

    <div id="datepickerDiv">
        <telerik:RadDatePicker ID="RadDateFoo" runat="server" Width="100"
            ShowPopupOnFocus="True"
            MinDate="01/01/2015"
            MaxDate="01/01/2016"
            DatePopupButton-Visible="True"
            EnableScreenBoundaryDetection="True"
            ShowAnimation-Type="Slide"
            HideAnimation-Type="Slide" />
        <asp:Literal ID="literalFoo" runat="server" Visible="false" />
        <asp:Literal ID="litStartDate" runat="server" Visible="false" />
    </div>

     

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 21 May 2015 Link to this post

    Hi,

    The presented behavior is not a specific for the RadDatePicker control but is mostly some specifics for the scenario you are implementing. It appears that for some reason the RadDatePicker control placed in your custom control is not bale to successfully download the required scripts for its proper functionality. Therefore in case the same control is added on the page those scripts are already downloaded and the picker placed in the custom control can already work properly.
    As I'm not aware of your custom control configuration and the exact application settings I can be sure what exactly is causing the presented issue. I  this case it will be best if you can send us isolated runnable version of your application that demonstrates the problem int he support ticket you have opened for this issue. Thus we will be able to debug it locally and advise you further.

    Regards,
    Maria Ilieva
    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