All,
I have two RadDateTimepickers within a MasterTableViewEditForm view in a radgrid. Everything works fine, but after interacting with the page or hitting the cancel button a few times, then I get the following error:
'this.get_timeview()' is null or not an object.
This only happens after going to edit a record and then hitting the cancel button after three times.
Below is the code for my RadGrid:
Any help would be greatly appreciated.
I have two RadDateTimepickers within a MasterTableViewEditForm view in a radgrid. Everything works fine, but after interacting with the page or hitting the cancel button a few times, then I get the following error:
'this.get_timeview()' is null or not an object.
This only happens after going to edit a record and then hitting the cancel button after three times.
Below is the code for my RadGrid:
<telerik:RadGrid ID="RadGrid2" runat="server" AllowAutomaticDeletes="True" |
AllowAutomaticInserts="True" AllowAutomaticUpdates="True" |
AutoGenerateEditColumn="True" |
DataSourceID="SqlDataSource2" GridLines="None" |
ShowGroupPanel="True" Skin="Web20" Width="95%" AllowPaging="True" ShowFooter="True" |
PageSize="5"> |
<mastertableview autogeneratecolumns="False" |
datasourceid="SqlDataSource2" |
CommandItemDisplay="Top"> |
<EditItemTemplate> |
</EditItemTemplate> |
<nestedviewtemplate> |
</nestedviewtemplate> |
<CommandItemSettings AddNewRecordText="Add New Day" /> |
<expandcollapsecolumn visible="True"> |
</expandcollapsecolumn> |
<Columns> |
<telerik:GridTemplateColumn HeaderText="Delete?" UniqueName="TemplateColumn"> |
<ItemTemplate> |
<asp:ImageButton ID="btndeleteday" runat="server" CommandName="DeleteDay" |
Height="25px" ImageUrl="~/images/recyclebin.png" |
Width="25px" onclick="btndeleteday_Click" /> |
<cc1:ConfirmButtonExtender ID="btndeleteday_ConfirmButtonExtender" |
runat="server" ConfirmOnFormSubmit="True" |
ConfirmText="Are you sure you want to delete this day?" Enabled="True" |
TargetControlID="btndeleteday"> |
</cc1:ConfirmButtonExtender> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" |
ReadOnly="True" SortExpression="ID" |
UniqueName="ID"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="LeaveType" HeaderText="Type" |
SortExpression="LeaveType" |
UniqueName="LeaveType"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="LeaveRequestDate" HeaderText="Request Date" |
SortExpression="LeaveRequestDate" |
UniqueName="LeaveRequestDate"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="LeaveHours" HeaderText="Hours" |
SortExpression="LeaveHours" |
UniqueName="LeaveHours"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="StartTime" DataType="System.DateTime" |
HeaderText="Start Time" |
SortExpression="StartTime" UniqueName="StartTime"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="EndTime" DataType="System.DateTime" |
HeaderText="End Time" |
SortExpression="EndTime" UniqueName="EndTime"> |
</telerik:GridBoundColumn> |
</Columns> |
<editformsettings editformtype="Template"> |
<editcolumn uniquename="EditCommandColumn1"> |
</editcolumn> |
<formtemplate> |
<fieldset style="padding:10px;"> |
<legend style="padding:5px;"><b>Edit Action: </b> |
<b> - </b> |
<asp:Label ID="lblstatus" Font-Bold="True" Font-Italic="True" |
Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>' runat="server" /> |
</legend> |
<asp:SqlDataSource ID="LeaveTypes" runat="server" |
ConnectionString="<%$ ConnectionStrings:TimetrexLeaveTestingConnectionString %>" |
SelectCommand="SELECT [ID], [LeaveType] FROM [LeaveTypes]"> |
</asp:SqlDataSource> |
<table class="TableNonImportantText" style="table-layout: auto; text-align: left; white-space: nowrap; width: 100%"> |
<asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="The following errors need to be corrected before you can Edit/Insert a day!" /> |
<tr> |
<td class="style63" nowrap="nowrap"> |
Leave Type:</td> |
<td class="style54"> |
<telerik:RadComboBox ID="drptypeleave" Runat="server" DataSourceID="LeaveTypes" |
DataTextField="LeaveType" DataValueField="ID" Skin="Web20" |
SelectedValue='<%# Bind("LeaveType_Fkey") %>'> |
</telerik:RadComboBox> |
</td> |
<td class="style61"> |
</td> |
<td class="style61"> |
</td> |
<td class="style60"> |
</td> |
<td class="style54"> |
<asp:Label ID="lblid" runat="server" Text='<%# eval("LeaveRequest_Fkey") %>' |
Visible="False"></asp:Label> |
<asp:Label ID="lblLeaveDateID" runat="server" Text='<%# eval("ID") %>' |
Visible="False"></asp:Label> |
</td> |
<td class="style56"> |
</td> |
<td class="style54"> |
</td> |
<td class="style54"> |
</td> |
</tr> |
<tr> |
<td class="style63" nowrap="nowrap"> |
Start Time:</td> |
<td class="style58" nowrap="nowrap"> |
<telerik:RadDateTimePicker ID="RadDateTimePickerStart" Runat="server" |
Culture="English (United States)" |
Skin="Web20" |
DbSelectedDate='<%# Bind("StartTime") %>'> |
<calendar skin="Web20" usecolumnheadersasselectors="False" |
userowheadersasselectors="False" |
viewselectortext="x"> |
</calendar> |
<timeview cellspacing="-1"> |
</timeview> |
<timepopupbutton hoverimageurl="" imageurl="" /> |
<datepopupbutton hoverimageurl="" imageurl="" /> |
</telerik:RadDateTimePicker> |
</td> |
<td class="style62" nowrap="nowrap"> |
<asp:RequiredFieldValidator ID="BeginValidator" runat="server" |
ControlToValidate="RadDateTimePickerStart" |
ErrorMessage="An begin date is required to submit a leave request!" |
Text="*"></asp:RequiredFieldValidator> |
</td> |
<td class="style62" nowrap="nowrap"> |
</td> |
<td class="style60" nowrap="nowrap"> |
End Time:</td> |
<td class="style58" nowrap="nowrap"> |
<telerik:RadDateTimePicker ID="RadDateTimePickerEnd" Runat="server" |
Culture="English (United States)" |
Skin="Web20" |
DbSelectedDate='<%# Bind("EndTime") %>'> |
<calendar skin="Web20" usecolumnheadersasselectors="False" |
userowheadersasselectors="False" |
viewselectortext="x"> |
</calendar> |
<timeview cellspacing="-1"> |
</timeview> |
<timepopupbutton hoverimageurl="" imageurl="" /> |
<datepopupbutton hoverimageurl="" imageurl="" /> |
</telerik:RadDateTimePicker> |
</td> |
<td class="style45" nowrap="nowrap"> |
<asp:RequiredFieldValidator ID="EndValidator" runat="server" |
ControlToValidate="RadDateTimePickerEnd" |
ErrorMessage="An end time is required to submit a leave request! " |
Text="*"></asp:RequiredFieldValidator> |
</td> |
<td class="style41"> |
</td> |
<td class="style41"> |
</td> |
</tr> |
<tr> |
<td class="style63" nowrap="nowrap"> |
<asp:Button ID="btnUpdate" runat="server" |
CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>' |
Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>' |
Width="79px" /> |
</td> |
<td class="style58" nowrap="nowrap"> |
<asp:Button ID="btncancel" runat="server" CausesValidation="False" |
CommandName="Cancel" Text="Cancel" |
Width="79px" /> |
</td> |
<td class="style62" nowrap="nowrap"> |
</td> |
<td class="style62" nowrap="nowrap"> |
</td> |
<td class="style60" nowrap="nowrap"> |
</td> |
<td class="style58" nowrap="nowrap"> |
</td> |
<td class="style45" nowrap="nowrap"> |
</td> |
<td class="style41"> |
</td> |
<td class="style41"> |
</td> |
</tr> |
<tr> |
<td class="style54" colspan="9"> |
<div id="validation" runat="server" visible="true" > |
<asp:CustomValidator ID="HoursPositive" runat="server" |
ControlToValidate="RadDateTimePickerStart" ErrorMessage="" |
OnServerValidate="ServerValidate"></asp:CustomValidator> |
<asp:CustomValidator ID="HoursCheck" runat="server" |
ControlToValidate="RadDateTimePickerStart" ErrorMessage="" |
OnServerValidate="ServerValidate"></asp:CustomValidator> |
<asp:CustomValidator ID="NoDays" runat="server" |
ControlToValidate="RadDateTimePickerStart" ErrorMessage="" |
OnServerValidate="ServerValidate"></asp:CustomValidator> |
<asp:CustomValidator ID="HoursUsable" runat="server" |
ControlToValidate="RadDateTimePickerStart" ErrorMessage="" |
OnServerValidate="ServerValidate"></asp:CustomValidator> |
</div> |
</td> |
</tr> |
</table> |
<telerik:RadAjaxManager ID="RadAjaxManager3" runat="server"> |
<ajaxsettings> |
<telerik:AjaxSetting AjaxControlID="grddays"> |
<updatedcontrols> |
<telerik:AjaxUpdatedControl ControlID="grddays" |
LoadingPanelID="radajaxloadingpanel1" /> |
<telerik:AjaxUpdatedControl ControlID="btnsubmit" /> |
<telerik:AjaxUpdatedControl ControlID="lblhoursannual" /> |
<telerik:AjaxUpdatedControl ControlID="lblhourssick" /> |
<telerik:AjaxUpdatedControl ControlID="lblhoursjury" /> |
<telerik:AjaxUpdatedControl ControlID="lblhoursbereavement" /> |
<telerik:AjaxUpdatedControl ControlID="lblhoursmilitary" /> |
<telerik:AjaxUpdatedControl ControlID="lblhourscomp" /> |
<telerik:AjaxUpdatedControl ControlID="lblhourswithoutpay" /> |
<telerik:AjaxUpdatedControl ControlID="lblholidaypay" /> |
<telerik:AjaxUpdatedControl ControlID="txtcomments" /> |
<telerik:AjaxUpdatedControl ControlID="validationsummary1" /> |
</updatedcontrols> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="grddays"> |
<updatedcontrols> |
<telerik:AjaxUpdatedControl controlid="grddays" /> |
</updatedcontrols> |
</telerik:AjaxSetting> |
</ajaxsettings> |
</telerik:RadAjaxManager> |
<br /> |
</fieldset></formtemplate> |
</editformsettings> |
<CommandItemTemplate> |
<table class="style11"> |
<tr> |
<td class="style54"> |
<asp:Image ID="Image6" runat="server" Height="25px" |
ImageUrl="~/images/folder_green.png" |
Width="25px" /> |
</td> |
<td> |
<asp:LinkButton ID="LinkButton4" runat="server" CommandName="InitInsert">Add New |
Day</asp:LinkButton> |
</td> |
</tr> |
</table> |
</CommandItemTemplate> |
</mastertableview> |
<clientsettings allowdragtogroup="True"> |
</clientsettings> |
</telerik:RadGrid> |