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

Script Error With Date Picker

5 Answers 91 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 18 Dec 2015, 06:32 PM

I have two DatePickers on an Edit Template of a grid.  When I'm adding a new record or editing an existing record of the grid, the DatePickers are throwing a script error: 'False' is undefined

 I also have enabled AutoPostBack="true" on the first DatePicker as I need to set a second DatePicker with a future date based on the date entered in the first DatePicker.  The Edit Template is wrapped in an Ajax Loading Panel, and based on this link: http://www.telerik.com/forums/146104-datepicker-script-error, I've set the flag EnablePageHeadUpdate to false and I'm still receiving the script error.

 Any ideas?

 Here's my code:

<telerik:RadGrid runat="server" ID="radAlerts" AllowPaging="True" AllowSorting="True" ShowHeader="True" GridLines="None"
    OnNeedDataSource="radAlerts_OnNeedDataSource" OnItemCommand="radAlerts_OnItemCommand" OnItemDataBound="radAlerts_OnItemDataBound"
    OnInsertCommand="radAlerts_OnInsertCommand" OnUpdateCommand="radAlerts_OnUpdateCommand" OnDeleteCommand="radAlerts_OnDeleteCommand">
    <ClientSettings AllowColumnsReorder="False" EnableRowHoverStyle="True" EnablePostBackOnRowClick="True">
        <Selecting AllowRowSelect="True"></Selecting>
        <Scrolling UseStaticHeaders="True"></Scrolling>
    </ClientSettings>
    <MasterTableView DataKeyNames="AlertId" AutoGenerateColumns="False" AllowMultiColumnSorting="True" EnableHeaderContextMenu="True"
        CommandItemDisplay="TopAndBottom" Height="100%">
        <NoRecordsTemplate>No Active Alerts.</NoRecordsTemplate>
        <CommandItemSettings ShowAddNewRecordButton="True" ShowCancelChangesButton="False" ShowSaveChangesButton="False" ShowRefreshButton="True" />
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                <HeaderStyle Width="1%"></HeaderStyle>
                <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" Width="1%"></ItemStyle>
            </telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn ConfirmText="Deactivate this item?" ConfirmDialogType="RadWindow" ConfirmTitle="Deactivate" ButtonType="ImageButton"
                CommandName="Delete" ConfirmDialogHeight="160px" ConfirmDialogWidth="250px" UniqueName="DeleteColumn">
                <HeaderStyle Width="1%"></HeaderStyle>
                <ItemStyle VerticalAlign="Top" Width="1%"></ItemStyle>
            </telerik:GridButtonColumn>
            <telerik:GridBoundColumn DataField="AlertId" HeaderText="ID" Visible="False"></telerik:GridBoundColumn>
            <telerik:GridTemplateColumn HeaderText="Alert">
                <HeaderStyle Width="50%"></HeaderStyle>
                <ItemStyle VerticalAlign="Top" HorizontalAlign="Left"></ItemStyle>
                <ItemTemplate>
                    <a href='viewattachment.aspx?alert_id=<%# Eval("AlertId") %>' target="_blank"><%# Eval("Title") %></a>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridDateTimeColumn DataField="StartDate" HeaderText="Start Date" DataFormatString="{0:d}" FilterControlWidth="80%" AutoPostBackOnFilter="True">
                <HeaderStyle Width="10%"></HeaderStyle>
                <ItemStyle VerticalAlign="Top" HorizontalAlign="Left"></ItemStyle>
            </telerik:GridDateTimeColumn>
            <telerik:GridDateTimeColumn DataField="EndDate" HeaderText="End Date" DataFormatString="{0:d}" FilterControlWidth="80%" AutoPostBackOnFilter="True">
                <HeaderStyle Width="10%"></HeaderStyle>
                <ItemStyle VerticalAlign="Top" HorizontalAlign="Left"></ItemStyle>
            </telerik:GridDateTimeColumn>
            <telerik:GridCheckBoxColumn DataField="Inactive" HeaderText="Inactive" AutoPostBackOnFilter="True">
                <HeaderStyle Width="5%"></HeaderStyle>
                <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" Width="5%"></ItemStyle>
            </telerik:GridCheckBoxColumn>
        </Columns>
        <EditFormSettings EditFormType="Template">
            <EditColumn UniqueName="AlertId" />
            <FormTemplate>
                <telerik:RadAjaxLoadingPanel runat="server" ID="radLpAlertTemplate"></telerik:RadAjaxLoadingPanel>
                <table class="editTable">
                    <tr>
                        <td class="left" style="width: 90px"><asp:Label runat="server" ID="lblTitle" Text="Title:"></asp:Label></td>
                        <td class="left">
                            <telerik:RadTextBox runat="server" ID="radAlertTitle" Width="80%" ClientIDMode="Static" MaxLength="100"></telerik:RadTextBox>
                            <asp:RequiredFieldValidator runat="server" ID="rvAlertTitle" ControlToValidate="radAlertTitle" ErrorMessage="Please enter alert text"
                                Display="Dynamic" ForeColor="Firebrick">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="left"><asp:Label runat="server" ID="lblExitingFile" Text="Existing file:"></asp:Label></td>
                        <td class="left"><asp:HyperLink runat="server" ID="hlAlertFile"></asp:HyperLink></td>
                    </tr>
                    <tr>
                        <td class="left"><asp:Label runat="server" ID="lblFile" Text="File: "></asp:Label></td>
                        <td class="left">
                            <telerik:RadAsyncUpload runat="server" ID="radAlertUpload" MaxFileInputsCount="1" Width="50%" />
                        </td>
                    </tr>
                    <tr>
                        <td class="left"><asp:Label runat="server" ID="lblStartDate" Text="Start Date:"></asp:Label></td>
                        <td class="left">
                            <telerik:RadDatePicker runat="server" ID="radAlertStartDate" AutoPostBack="True"
                                OnSelectedDateChanged="radAlertStartDate_OnSelectedDateChanged">
                                <Calendar>
                                    <SpecialDays>
                                        <telerik:RadCalendarDay Repeatable="Today">
                                            <ItemStyle BackColor="LightGray" Font-Bold="True" BorderStyle="Solid" BorderColor="Black" BorderWidth="1px"></ItemStyle>
                                        </telerik:RadCalendarDay>
                                    </SpecialDays>
                                </Calendar>
                                <DateInput DisplayDateFormat="yyyy-MM-dd" DateFormat="yyyy-MM-dd"></DateInput>
                            </telerik:RadDatePicker>
                            <asp:RequiredFieldValidator runat="server" ID="rvStartDate" ControlToValidate="radAlertStartDate" ErrorMessage="Please enter a Starting Date"
                                Display="Dynamic">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="left"><asp:Label runat="server" ID="lblEndDate" Text="End Date:"></asp:Label></td>
                        <td class="left">
                            <telerik:RadDatePicker runat="server" ID="radAlertEndDate">
                                <Calendar>
                                    <SpecialDays>
                                        <telerik:RadCalendarDay Repeatable="Today">
                                            <ItemStyle BackColor="LightGray" Font-Bold="True" BorderStyle="Solid" BorderColor="Black" BorderWidth="1px"></ItemStyle>
                                        </telerik:RadCalendarDay>
                                    </SpecialDays>
                                </Calendar>
                                <DateInput DisplayDateFormat="yyyy-MM-dd" DateFormat="yyyy-MM-dd"></DateInput>
                            </telerik:RadDatePicker>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:CheckBox runat="server" ID="cbInactive" Text="Inactive" Checked="False" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"> </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="text-align: left">
                            <asp:Button runat="server" ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' />
                            <asp:Button runat="server" ID="btnCancel" Text="Cancel" CommandName="Cancel" CausesValidation="False" />
                        </td>
                    </tr>
                </table>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

5 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 21 Dec 2015, 02:17 PM
Hello Mike,

I tried to replicate the problem, however I was not able to. I used the provided markup to create a sample WebSite project with dummy data.

After running the project there were no errors on my end. I am attaching the sample as reference. Would you give it a try and let me know what should be different in order to reproduce the error you are seeing?


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
Mike
Top achievements
Rank 1
answered on 21 Dec 2015, 04:26 PM

I created a new solution and brought in your code.  I'm still getting the same script error.  How can I attach the zip file?

 I'm also using the latest Telerik version - 2015.3.1111 and Visual Studio 2013.

0
Viktor Tachev
Telerik team
answered on 24 Dec 2015, 08:40 AM
Hello Mike,

You can modify the code from the sample and paste it in a Code Block in this thread. Alternatively you can upload the modified sample in a file sharing server and provide a download link.

Moreover, you can open a support ticket and attach the project there.

Thus, we could examine the scenario you have and look for what is causing the error.

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
Mike
Top achievements
Rank 1
answered on 04 Jan 2016, 04:51 PM
Ok, I'll open a support ticket.  Thanks!
0
Viktor Tachev
Telerik team
answered on 05 Jan 2016, 03:31 PM
Hi Mike,

I have replied in the support ticket and suggest we continue the conversation there. Give the suggestion a try and see how it works for you.


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
DatePicker
Asked by
Mike
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Mike
Top achievements
Rank 1
Share this question
or