| <telerik:RadEditor ID="RadEditor1" runat="server""> |
| <DocumentManager ViewPaths="~/support/upload/docs" UploadPaths="~/support/upload/docs" DeletePaths="~/support/upload/docs" SearchPatterns="*.doc, *.docx, *.pdf, *.txt" MaxUploadFileSize="2097152" /> |
| <Content></Content> |
| </telerik:RadEditor> |

<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head runat="server">
<title>Untitled Page</title>
</
head>
<
body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="End"
DataKeyField="ID" DataSourceID="ObjectDataSource1" DataStartField="Start"
DataSubjectField="Subject">
</telerik:RadScheduler>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="AllData" TypeName="AppointmentList"></asp:ObjectDataSource>
</div>
</form>
</
body>
</
html>
Hi everybody,
I am using the RadGridScheduler Component to manage Activities by moving, editing or deleting them. In order to display a detailed view of the activity, a details window is opened using the RadWindowManager.
On this details view there is a button to delete the current activity. When I do this, the window gets closed and a javascript callback method is called from the scheduler’s aspx site to refresh the current content.
However, after the activity has been deleted within the RadScheduler’s AppointmentDelete event and the aspx site gets load again, the following Exception has been thrown:
[NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.]
Telerik.Web.UI.SchedulerPostBackEvent.DeserializeFromJSON(String json) +85
Telerik.Web.UI.RadScheduler.RaisePostBackEvent(String eventArgument) +67
Telerik.Web.UI.RadScheduler.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +177
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
Has anybody an idea, what went wrong?
Thanks in advance.
I was struggling with this issue of trying to reference controls within the same Edit Template, when using the OnCheckChanged method of the Checkbox in the template. See the solution below. Hope this saves someone some time and effort.
Obtaining values of controls within a EditTemplate when utilizing the OnCheckedChanged method of a checkbox control in the same Template.
This uses a Server Side event.
protected
void CheckedChanged(object sender, System.EventArgs e)
{
CheckBox chkBox = (sender as CheckBox);
GridDataItem item = (GridDataItem)chkBox.NamingContainer;
RequiredFieldValidator reqval = (RequiredFieldValidator)item["EndDateTime"].FindControl("reqEndDate");
RegularExpressionValidator regexval = (RegularExpressionValidator)item["EndDateTime"].FindControl("regexEndDate");
if (chkBox.Checked)
{
reqval.Enabled =
false;
regexval.Enabled =
false;
}
}
Here is the ASPX
<EditItemTemplate>
<asp:TextBox ID="EndDateTimeTextBox" runat="server" ></asp:TextBox><asp:RequiredFieldValidator
ID="reqEndDate" runat="server" ControlToValidate="EndDateTimeTextBox" ErrorMessage="A valid US Date & Time is Required."
Style="left: 2px; position: relative">*</asp:RequiredFieldValidator><asp:RegularExpressionValidator
ID="regexEndDate" runat="server" ControlToValidate="EndDateTimeTextBox" ErrorMessage="Please enter a valid US Date & Time."
Style="position: relative" ValidationExpression="^(([1-9])|(0[1-9])|(1[0-2]))\/(([0-9])|([0-2][0-9])|(3[0-1]))\/(([0-9][0-9])|([1-2][0,9][0-9][0-9]))\s(1[0-2]|[1-9])\:[0-5][0-9]\s(a|p|A|P)(m|M)$">*</asp:RegularExpressionValidator>
<br />
<asp:CheckBox ID="chkIsFullDay" runat="server" Style="position: relative" Text="Full Day" AutoPostBack="True" OnCheckedChanged="CheckedChanged" />
</EditItemTemplate>