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

Problem with Update

10 Answers 171 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 21 Aug 2008, 03:21 PM
I'm using the scheduler against a SharePoint List using an SPDataSource like this:

            <sharepoint:SPDataSource DataSourceMode="List" 
                Scope="Default" UseInternalName="true"   
                IncludeHidden="true"   
                ID="spdsCalendar" runat="server">  
                <SelectParameters> 
                    <asp:Parameter Name="ListName" DefaultValue="TravelCalendarList" /> 
                </SelectParameters> 
                <InsertParameters> 
                    <asp:Parameter Name="ListName" DefaultValue="TravelCalendarList" /> 
                </InsertParameters> 
                <UpdateParameters> 
                    <asp:Parameter Name="ListName" DefaultValue="TravelCalendarList" /> 
                </UpdateParameters> 
                <DeleteParameters> 
                    <asp:Parameter Name="ListName" DefaultValue="TravelCalendarList" /> 
                </DeleteParameters> 
            </sharepoint:SPDataSource> 

I have the Update wired up correctly:

        protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)  
        {  
            try 
            {  
                if ((e.ModifiedAppointment.Subject == String.Empty) | (e.ModifiedAppointment.Start > e.ModifiedAppointment.End))  
                {  
                    e.Cancel = true;  
                }  
                else 
                {  
                    e.Appointment.Subject = e.ModifiedAppointment.Subject;  
                    e.Appointment.Start = e.ModifiedAppointment.Start;  
                    e.Appointment.End = e.ModifiedAppointment.End;  
                }  
            }  
            catch (Exception ex)  
            {  
                lblError.Text = ex.Message.ToString();  
            }  
        }  
 

When I click Update I get the follow error:

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

System.NullReferenceException: Object reference not set to an instance of an object.

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.Scheduling.DataSourceViewSchedulerProvider.OnDataSourceOperationComplete(Int32 count, Exception e) +16
   System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +69
   Telerik.Web.UI.Scheduling.DataSourceViewSchedulerProvider.Update(RadScheduler owner, Appointment appointmentToUpdate) +192
   Telerik.Web.UI.Scheduling.AppointmentController.UpdateAppointment(Appointment originalAppointment, Appointment modifiedAppointment) +363
   Telerik.Web.UI.RadScheduler.UpdateAppointmentInline(Boolean removeExceptions) +195
   Telerik.Web.UI.RadScheduler.OnBubbleEvent(Object source, EventArgs args) +235
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +115
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +132
   System.Web.UI.WebControls.LinkButton.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

I have written out the values from ModifiedAppointment to a label and it all looks correct. Both Insert and Delete work fine.

Anyone have an ideas as to what's going wrong with the Update?

cheers,

Steve

10 Answers, 1 is accepted

Sort by
0
Steve
Top achievements
Rank 1
answered on 22 Aug 2008, 11:24 AM
I tried setting some hardcoded values to the list inside the Update event like below:

        protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)  
        {  
            SPWeb oWeb = SPContext.Current.Web;  
            SPList oList = oWeb.Lists["TravelCalendarList"];  
            SPListItem itm = oList.GetItemById(1);  
            if (null != itm)  
            {  
                itm["Location"] = "test";  
                itm["Title"] = "test";  
                itm.Update();  
                RadScheduler1.Rebind();  
            }  
        }  
 

The SharePoint List item gets updated fine but I still get the error. To reiterate, both Insert and Delete work fine.

Object reference not set to an instance of an object

0
Dimitar Milushev
Telerik team
answered on 25 Aug 2008, 02:16 PM
Hi Steve,

Can you please share some more details about how you use RadScheduler in your Sharepoint installation? Does the RadScheduler instance reside in a Web Part or a User Control, etc. We would like to reproduce your issue as closely as possible so we can debug it locally.

All the best,
Dimitar Milushev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Steve
Top achievements
Rank 1
answered on 26 Aug 2008, 08:07 AM
Hi Dimitar -

I'm using Scheduler in a UserControl within a WebPart. In other words, I have 2 solution packages: one contains the WebPart, with custom List Templates; the other contains a series of UserControls which are dynamically injected into the WebPart at runtime.

If you give me an address to send them to I could probably send you both solutions if you think it will help to speed up a resolution to this issue.

Both solutions are built using WSPBuilder.

cheers,

Steve
0
Dimitar Milushev
Telerik team
answered on 26 Aug 2008, 11:45 AM
Hello Steve,

Sending us the solutions would be of great help. You can open a support ticket through your Client.Net account and attach the files to the ticket.

Thank you in advance.

Best wishes,
Dimitar Milushev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Steve
Top achievements
Rank 1
answered on 26 Aug 2008, 04:27 PM
When I try to add a Support Ticket via the Client.net section, I can only see the RadControls for ASP.NET to select from.

Can you get my profile updated so I can add this ticket in the appropriate section for the latest Telerik AJAX dll?

cheers,

Steve
0
Steve
Top achievements
Rank 1
answered on 27 Aug 2008, 08:50 AM
Could someone please update my Telerik profile so that I can add a Support Ticket in for RadScheduler.

At the moment I can only see the older version of the controls and need to add a ticket regarding the latest RadScheduler control.
0
Steve
Top achievements
Rank 1
answered on 27 Aug 2008, 03:46 PM
I've added my solutions to a ticket. Ticket number is 158396
0
Paul
Telerik team
answered on 28 Aug 2008, 08:52 AM
Hello Steve,

Actually, there's no need to request this from us (Telerik), but from the person responsible for your company's purchase. Here's the situation. We have four product lines:

  • RadControls for ASP.NET AJAX
  • RadControls for ASP.NET
  • Telerik Reporting
  • RadControls for WinForms
If you are added (from the person responsible for your company's purchase) as a licensed developer to RadControls for ASP.NET only, you won't have access from your Client.net account to the rest of the product lines.

For your convenience, I have added you as licensed developers to RadControls for ASP.NET AJAX license that Steve Ke has purchased.

Greetings,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Steve
Top achievements
Rank 1
answered on 28 Aug 2008, 09:19 AM
Thanks Paul, I didn't know that this was the case.

Do I need to submit another support ticket or will the one I already submitted suffice?
0
Paul
Telerik team
answered on 28 Aug 2008, 11:54 AM
Hi Steve,

There's no need to submit another support ticket. Ticket ID158396 has been already assigned to the responsible support officer and you will get a reply within the guaranteed response time.

Greetings,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
Steve
Top achievements
Rank 1
Answers by
Steve
Top achievements
Rank 1
Dimitar Milushev
Telerik team
Paul
Telerik team
Share this question
or