I have tried the following:
RadScheduler1.Appointments.FindByID
RadScheduler1.ShowAdvancedEditForm(apt);
It displays the Advanced Edit Template, but then the Edit functionality of the page is lost. When the same page is edited by clicking on an appointment, the edit functionality works.
Thanks
Gerrit
16 Answers, 1 is accepted
Please, set StartEditingInAdvancedForm="true" and StartInsertingInAdvancedForm="true" for RadScheduler.
Kind regards,
Peter
the Telerik team
I am getting "Object reference not set to an instance of an object." Error when Click on save button inside Edit Appointment.
Please Help ME !!!!
Error Content
Server Error in '/TelerikControls' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
|
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] Telerik.Web.UI.AdvancedTemplate.get_RecurrenceRuleText() +552 Telerik.Web.UI.AdvancedTemplate.ExtractValues(Control container) +444 Telerik.Web.UI.RadScheduler.UpdateAppointmentInline(Boolean removeExceptions) +137 Telerik.Web.UI.RadScheduler.OnBubbleEvent(Object source, EventArgs args) +468 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +125 System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +169 System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +9 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +176 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563 |
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Thank you for submitting the full stack trace.
The error doesn't seem to be related to the StartEditingInAdvancedForm and StartInsertingInAdvancedForm properties. We tried to reproduce this error, but without success. We need to understand your scenario better in order to proceed. Can you please send us the source code of the page?
Greetings,
Tsvetomir Tsonev
the Telerik team
EnableScriptCombine="false" EnablePartialRendering="false" OutputCompression="Disabled"
In the scriptmanager, or I would get an error in the the Microsoft ajax javascript file instead.
I get this error when saving or updating with one of the schedulers advanced insert/edit forms.
My Scheduler is populated via a cusom provider (that connects to a microsoft exchange service) set in the code behind on load.
The scheduler markup is very basic, and it uses it's default functionality/templates.
<
telerik:RadScheduler
ID
=
"LiveAtEduCalendar"
Skin
=
"Forest"
SelectedView
=
"MonthView"
FirstDayOfWeek
=
"Monday"
LastDayOfWeek
=
"Sunday"
AppointmentStyleMode
=
"Default"
ShowFooter
=
"false"
OnLoad
=
"LiveAtEduCalendar_Load"
runat
=
"server"
>
<
WeekView
HeaderDateFormat
=
"d"
/>
<
TimelineView
UserSelectable
=
"false"
/>
</
telerik:RadScheduler
>
We haven't been able to replicate this problem locally. Can you try with some other data source, SQL or XML provider for example and let me know if this makes a difference?
Greetings,
Peter
the Telerik team
Project Reference : SchedulerCustomAdvancedFormQ1_2010_SP1
Functionality: Instead of using Type and Resrouce as AdvanceTemplate Resources, i am trying to use Institute Name (InstituteName) and Institute Address (InstituteAddress) as resources in form of ComboBoxs.
Backend in SQLdatabase, i am using three tables.
1. Appointments
2. Institute_Name
3. Institute_Address
Institute_Name primary key is Inst_Sr_Id and Institute_Address primary key is Inst_Add_Sr and both are Foreign Keys in Appointments table.
Here is code that is used to bind their properties.
'Type, Resource
<Bindable(BindableSupport.Yes, BindingDirection.TwoWay)> _
Public Property InstituteName() As String
Get
Return InstituteNameComboBox.SelectedItem.Value
End Get
Set(ByVal value As String)
InstituteNameComboBox.SelectedValue = value
End Set
End Property
<Bindable(BindableSupport.Yes, BindingDirection.TwoWay)> _
Public Property InstituteAddress() As String
Get
Return InstituteAddressComboBox.SelectedItem.Value
End Get
Set(ByVal value As String)
InstituteAddressComboBox.SelectedValue = value
End Set
End Property
Below is code that override InstituteName and InstituteAddress property and bind it to Control in AdvanceTemplate
<AdvancedEditTemplate>
<scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1"
Mode="Edit" Subject='<%# Bind("Subject") %>'
Description='<%# Bind("Description") %>'
Start='<%# Bind("Start") %>'
End='<%# Bind("End") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
AppointmentColor='<%# Bind("AppointmentColor") %>'
InstituteName = '<%# Bind("InstituteName")%>'
InstituteAddress= '<%# Bind("InstituteAddress")%>'
/>
</AdvancedEditTemplate>
<AdvancedInsertTemplate>
<scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1"
Mode="Insert" Subject='<%# Bind("Subject") %>'
Description='<%# Bind("Description") %>'
Start='<%# Bind("Start") %>'
End='<%# Bind("End") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
AppointmentColor='<%# Bind("AppointmentColor") %>'
InstituteName = '<%# Bind("InstituteName")%>'
InstituteAddress= '<%# Bind("InstituteAddress")%>'
/>
</AdvancedInsertTemplate>
The above code did help me to store Appointment Information but it was not helping to store Institute Name and Institute Address value into database untill i added the following code:
<telerik:ResourceType ForeignKeyField="Inst_Sr_Id"
KeyField="Inst_Sr_Id" Name="InstituteName" TextField="Inst_Name" />
<telerik:ResourceType ForeignKeyField="Inst_Add_Sr"
KeyField="Inst_Add_Sr" Name="InstituteAddress" TextField="Inst_Address" />
</ResourceTypes>
Now the Appointment Color, Institute Name and Address are getting store properly in Database BUT, once i try to edit any appointment, Institute_Name and Institute_Address does't pick their default value that is stored in database. Their behavoir is kind of normal which means on return value from database to Advance control, Values are not getting bind.
In AdvanceTemplate.ASCX, I am using two RadComboBox controll with Two SQLDatasource to populate data from database. Institute_Name popolate institute name data from Institute_Name table and on selection of any particular insitute, InstituteAddressComboBox change its data and pick all list of address that associate to particular Institute.
Can you please look into code and suggest for the following Issue
1. why Two way binding is not working for RadComboBox ( InstituteName and InstituteAddress)
2. In Appointment Template why the following Code is not working.
<AppointmentTemplate>
<div class="rsAptSubject">
<h3><%# Eval("Subject") %></h3>
</div>
<%# Eval("Description") %>
<P>
Institute : <i><%#Eval("InstituteName.Text")%></i>
</P>
<P>
Address : <i><%#Eval("InstituteAddress.Text")%></i>
</P>
</AppointmentTemplate>
I have Also changed the CustomAttributeNames to :
CustomAttributeNames="AppointmentColor,InstituteName,InstituteAddress"
May be i am asking too much ! or may be i have explained alot and problem could be minor. Please help so i may assemble it for demonstration to my supirors.
Regards
Adnan
Thank you for the detailed explanation. I was able to understand your issue. However I'll need your code so I can inspect it and tell you what is wrong.
Could you please send me your project as well as the database?
Thank you!
Regards,
Veronica Milcheva
the Telerik team
May i ask you whether you manage to get this issue resolved by Telerik? 2am in the night and I am having the same problem.
This is the error I am getting when I try to save a new appointment.
Object reference not set to an instance of an object.
NullReferenceException: Object reference not set to an instance of an object.]
Telerik.Web.UI.AdvancedTemplate.get_RecurrenceRuleText() +554
Telerik.Web.UI.AdvancedTemplate.ExtractValues(Control container) +479
Telerik.Web.UI.RadScheduler.UpdateAppointmentInline(Boolean removeExceptions) +160
...
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17626
And following the schedule example on the documents.
And I am using the same Appointments.xml.
And I haven't made any changes to the code either.
Please advice
Thanks and Cheers
It is not very clear how to reproduce the issue you described. That is why I prepared a sample project based on this Code Library that uses AdvancedTemplate for RadScheduler AdvancedForm . RadScheduler is using XML document as data source and its AdvacedTemplate markup code can be found in AdvacedFrom.ascx file. Please review ti and let me know what should I change in order to observe the same behavior.
I hope this will be helpful.
Regards,
Boyan Dimitrov
the Telerik team
Have been trying to create a brand new appointment for the past 4 weeks. But it keep son throwing the same error as reported by a few of you above.
Scenario:
As my appointment resources can have multiple values (eg; Room 1, Room2), I am using a custom database provider using Entity Framework 6. I couldn't register the provider using the Web.Config it just kept on throwing error, so I am setting provider in the Page_Load of the code behind.
Using the Inline Advanced Insert template when I try to the save appointment information, it keeps throwing the below error.
Its been close to 3 weeks struggling with this same error and any help will be HIGHLY appreciated!
This is stack trace -
Object reference not set to an instance of an object.
at Telerik.Web.UI.AdvancedTemplateBase.get_RecurrenceRuleText()
at Telerik.Web.UI.AdvancedTemplateBase.ExtractValues(Control container)
at Telerik.Web.UI.RadScheduler.InsertAppointmentInline()
at Telerik.Web.UI.RadScheduler.OnBubbleEvent(Object source, EventArgs args)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
We tried to reproduce this error, but without success. We need to understand your scenario better in order to proceed. In order to debug and investigate this problem we would need a sample page or project we can test with. Could you please open a support ticket and attach a runnable sample project that replicates this error?
Regards,
Boyan Dimitrov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Resolved it :-)
My Scenario?
Use Entity Framework with a Custom Databae Provider
What was I trying to do?
I am using a custom database provider to bind the Scheduler. This provider uses Entity Framework 6 to connecto the database. I couldn't register the provider using the Web.Config it just kept on throwing error -
"Parser Error Message: Unable to find the requested .Net Framework Data Provider. It may not be installed"
So I had to set the provider in the Page_Load of the code behind. Using the Inline Insert template when I tried to the save an appointment, I kept on getting this below error -
"Object reference not set to an instance of an object.
at Telerik.Web.UI.AdvancedTemplateBase.get_RecurrenceRuleText()
at Telerik.Web.UI.AdvancedTemplateBase.ExtractValues(Control container)
at Telerik.Web.UI.RadScheduler.InsertAppointmentInline()
at Telerik.Web.UI.RadScheduler.OnBubbleEvent(Object source, EventArgs args)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)"
Root Cause?
Any custom databaseprovider needs a classic ADO.NET connection string associated with it in the web.config file. That connection string can be fake and crap but it is still required. In my scenario I had this in my web.config file -
<connectionStrings>
<add name="EFConnection" connectionString="metadata=res://*/ModelEF.csdl|res://*/ModelEF.ssdl|res://*/ModelEF.msl;provider=System.Data.SqlClient;provider connection string="data source=DBServer;initial catalog=SampleDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<telerik.web.ui>
<radScheduler defaultAppointmentProvider="Integrated">
<appointmentProviders>
<add name="DBSchedulerData" type="TestDataProvider.DataProviderEF" connectionStringName="EFConnection" persistChanges="true" />
</appointmentProviders>
</radScheduler>
</telerik.web.ui>
Though everything is correct here, I kept on getting the above two errors because that connection string was for EntityFramework.
Solution?
To fix all these errors I added a new fake connection string to my web.config file. And associated this new sonnection string with my custom provider. Here is my updated web.config -
<connectionStrings>
<add name="EFConnection" connectionString="metadata=res://*/ModelEF.csdl|res://*/ModelEF.ssdl|res://*/ModelEF.msl;provider=System.Data.SqlClient;provider connection string="data source=DBServer;initial catalog=SampleDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
<add name="FakeConnection" connectionString="Data Source=fakebaby;initial catalog=fakeuser;integrated security=True;" providerName="System.Data.SqlClient" />
</connectionStrings>
<telerik.web.ui>
<radScheduler defaultAppointmentProvider="Integrated">
<appointmentProviders>
<add name="DBSchedulerData" type="TestDataProvider.DataProviderEF" connectionStringName="FakeConnection" persistChanges="true" />
</appointmentProviders>
</radScheduler>
</telerik.web.ui>
I attached a sample project i did scheduler on it.
Please leave a message if someone find where is is the problem.
thanks,
I have the same issue . I am triying to edit an appointement from a user shared calendar but get the exception :
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.
at Telerik.Web.UI.AdvancedTemplateBase.get_RecurrenceRuleText()
at Telerik.Web.UI.AdvancedTemplateBase.ExtractValues(Control container)
at Telerik.Web.UI.RadScheduler.UpdateAppointmentInline(Boolean removeExceptions)
at Telerik.Web.UI.RadScheduler.OnBubbleEvent(Object source, EventArgs args)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
Any idea ?
Thanks a lot
I am also now receiving an null reference error when opening an appointment in the advanced template and then trying to save it. Same exact stack trace. This is code that has existed and worked for over a year now. No changes to it at all 2 things have changed in the environment.
We migrated to EF 6 (from 5)
We migrated to 2015.2.623.45
The stack trace does not give very good direction and we can't seem to break into the error, so we are not sure what direction to look... any thoughts or direction would be helpful.
Thanks
Unfortunately we could not replicate the issue. You can try to isolate it into a sample project and submit a support ticket about it so we could inspect tit and be more helpful.
Regards,
Plamen
Telerik