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

Drag from External Listbox (Null Object Reference Exception) On ScheduleViewDragDropBehavior.Drop)

5 Answers 165 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 27 Mar 2012, 05:13 PM
I'm trying to drag from an external list box to the schedule view control, but i'm getting a "Object reference not set to an instance of an object." Exception in the DragDropBehavior.Drop.

 at Telerik.Windows.Controls.ScheduleViewBase.CreateNew(IAppointment appointment) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Editing.cs:line 96
   at Telerik.Windows.Controls.ScheduleViewDragDropBehavior.CopyAppointment(DragDropState state, Slot targetSlot, IAppointment appointment) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\DragDropBehavior\ScheduleViewDragDropBehavior.cs:line 447
   at Telerik.Windows.Controls.ScheduleViewDragDropBehavior.Drop(DragDropState state) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\DragDropBehavior\ScheduleViewDragDropBehavior.cs:line 110
   at MAXIS.Scheduling.ScheduleItem.ScheduleViewDragDropBehavior.Drop(DragDropState state) in C:\Projects\_AX\Production\Scheduling\MAXIS.Sch

It's a custom Appointment. I've implemented the copy & the copyfrom methods like is shown in the examples. I can drag & drop from within the control just fine, but dragging a appointment from a listbox throws the exception.  the only difference i see in the state object is that the SourceAppointmentsSource is nothing.

The control version is 2012.1.215.40

5 Answers, 1 is accepted

Sort by
0
Dan
Top achievements
Rank 1
answered on 27 Mar 2012, 06:07 PM
Apparently i cannot have a constructor other than the default for my custom appointment items.
0
Yana
Telerik team
answered on 30 Mar 2012, 08:32 AM
Hi Dan,

Please find attached an example which demonstrates how the drag and drop between the ScheduleView and ListBox should be implemented.

Hope this helps.

Greetings,
Yana
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Siddartha
Top achievements
Rank 1
answered on 17 Oct 2012, 09:31 PM

System.NullReferenceException

Object reference not set to an instance of an object.

at Microsoft.Windows.Design.Platform.SilverlightMetadataContext.SilverlightXamlExtensionImplementations.<GetXmlNamespaceCompatibilityMappings>d__8.MoveNext() at MS.Internal.Design.Metadata.ReflectionProjectNode.BuildSubsumption() at MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(Identifier identifier) at MS.Internal.Design.Markup.XmlElement.BuildScope(PrefixScope parentScope, IParseContext context) at MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider) at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(Boolean convertToXamlWithErrors) at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.get_RootItem() at Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiableRootItem() at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.get_LoadState() at MS.Internal.Host.PersistenceSubsystem.Load() at MS.Internal.Host.Designer.Load() at MS.Internal.Designer.VSDesigner.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.Load() at MS.Internal.Designer.DesignerPane.LoadDesignerView()



is the exception i m facing
and i cannot see the designer page in silverlight visual studio 2010
i tried installing silverlight5 sdk and toolkit but still can't see the designer page
please help me ..................
0
amine
Top achievements
Rank 1
answered on 30 Mar 2018, 01:04 PM

Hi,

Can you help me please, I have the same error.

 

Please Admin can you update your project

0
amine
Top achievements
Rank 1
answered on 30 Mar 2018, 01:30 PM
problem resolved, ItemsSource must be an ObservableCollection
Tags
ScheduleView
Asked by
Dan
Top achievements
Rank 1
Answers by
Dan
Top achievements
Rank 1
Yana
Telerik team
Siddartha
Top achievements
Rank 1
amine
Top achievements
Rank 1
Share this question
or