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

Grid with timepicker

1 Answer 161 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Troels
Top achievements
Rank 1
Troels asked on 08 Mar 2011, 11:37 AM
Hello,

I have an RadGrid with a DateTimePicker and a RadTimePicker in seperate GridTemplateColumn, so they are open for editing. When I do a postback (Save), I validates the DateTimePicker and RadTimePicker for each row to be sure they have valid data. If they don't have valid data then I set one of the labels to visible. When the page loads again I get a JavaScript error in Telerik.Web.UI.WebResource.axd.

I have no Ajax on the grid, just a standard grid with EditMode="InPlace"

The error:
Line: 16937
Error: 'this.get_timeView()' is null or not an object

The line in telerik code:
this._timePopupContainerID=this.get_timeView().get_id()+"_wrapper";


<telerik:GridTemplateColumn HeaderText="Date" UniqueName="Date">       
    <ItemTemplate>     
        <telerik:RadDatePicker ID="rdpDate" runat="server" DatePopupButton-Visible="true" Width="100px">   
                    <DateInput ID="DateInputDate" runat="server" InvalidStyleDuration="100">   
                            <ClientEvents OnError="OnRadDatePickerError" />   
                        </DateInput>   
                        <DatePopupButton ToolTip="Select date" />   
                </telerik:RadDatePicker>   
                <asp:CustomValidator ID="cvDate" runat="server" ErrorMessage="<br />Invalid date"   
                    ValidationGroup="Gameplan" SetFocusOnError="true" Display="Dynamic" ControlToValidate="rdpDate"   
                        ClientValidationFunction="ValidateRadDatePickers"></asp:CustomValidator>   
                <asp:RequiredFieldValidator ID="rfvDate" runat="server" ControlToValidate="rdpDate"
                    Display="Dynamic" ErrorMessage="<br />Mandatory" ValidationGroup="Gameplan"   
                    SetFocusOnError="true"></asp:RequiredFieldValidator>   
                <asp:Label ID="lblMatchDate" runat="server" ForeColor="Red" Visible="False"><br />Date error</asp:Label><asp:Label
                    ID="lblLastDateError" runat="server" ForeColor="Red" Visible="False"><br />Last date error</asp:Label>
    </ItemTemplate>   
</telerik:GridTemplateColumn>   
<telerik:GridTemplateColumn HeaderText="Tidspunkt" UniqueName="Time">   
    <ItemTemplate>   
        <telerik:RadTimePicker ID="rtpTime" runat="server" TimePopupButton-Visible="true" Width="65px">   
                    <DateInput ID="DateInputTime" runat="server" InvalidStyleDuration="100">   
                            <ClientEvents OnError="OnRadTimePickerError" />   
                        </DateInput>   
                </telerik:RadTimePicker>   
            <asp:CustomValidator ID="cvTime" runat="server" ErrorMessage="<br />Wrong format"   
                    ValidationGroup="Gameplan" ControlToValidate="rtpTime" ClientValidationFunction="ValidateRadTimePickers"   
                    SetFocusOnError="true" Display="Dynamic"></asp:CustomValidator>  
    </ItemTemplate>   
</telerik:GridTemplateColumn>

Can you tell what is wrong?

Thanks

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 11 Mar 2011, 11:50 AM
Hello Troels,

I am not sure what is causing the problem, so could you please also paste your javascript code, so we can test your approach in a sample application and see if we can replicate the issue locally.

In the meantime you could check if the error goes away when you set SetFocusOnError="false" to the validators.

All the best,
Tsvetina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Grid
Asked by
Troels
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or