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

Object not set to an instance of an object

3 Answers 120 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Hugo Aristizabal
Top achievements
Rank 2
Hugo Aristizabal asked on 03 Feb 2010, 01:40 PM
Hi. I placed a TileView control in my XAML page, and it compiles fine and I can see the control at design time. However, when the page loads at runtime, I get the exception follwoing exception:

Object reference not set to an instance of an object.

at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.FindRootVisual() at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.Initialize() at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.OnAllowDragChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType) at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal) at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.SetAllowDrag(DependencyObject obj, Boolean value) at Telerik.Windows.Controls.RadTileViewItem.OnApplyTemplate() at System.Windows.FrameworkElement.ApplyTemplate() at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Canvas.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Border.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Designer.SimpleViewManager.DesignerBackground.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Decorator.MeasureOverride(Size constraint) at Microsoft.Windows.Design.Interaction.DesignerView.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Designer.Viewport.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Interop.HwndSource.SetLayoutSize() at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value) at System.Windows.Interop.HwndSource.set_RootVisual(Visual value) at MS.Internal.Designer.VSIsolatedDesigner.ViewHolder.Initialize() at MS.Internal.Designer.VSIsolatedDesigner.ViewHolder..ctor(UIElement content) at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.get_ViewHandle() at MS.Internal.Host.Isolation.IsolatedView.get_ViewHandle() at MS.Internal.Designer.DesignerPane.LoadDesignerView()

My TileView's XAML is this:




<NavigationControls:RadTileView Grid.ColumnSpan="4" Name="radTileView1" Grid.Row="1" 
                                Margin="5" Width="800" Height="450" MinimizedColumnWidth="150"
    <NavigationControls:RadTileViewItem> 
        <NavigationControls:RadTileViewItem.Header> 
            <TextBlock Text="Vehículo header"></TextBlock> 
        </NavigationControls:RadTileViewItem.Header> 
        <NavigationControls:RadTileViewItem.Content> 
            <Controls:RadFluidContentControl AnimationControls:AnimationManager.IsAnimationEnabled="True" 
                                             SmallToNormalThreshold="291,130" 
                                             NormalToSmallThreshold="292,131" 
                                             NormalToLargeThreshold="735,350" 
                                             LargeToNormalThreshold="731,351"
                <Controls:RadFluidContentControl.SmallContent> 
                    <TextBlock Text="Vehículo small"></TextBlock> 
                </Controls:RadFluidContentControl.SmallContent> 
                <Controls:RadFluidContentControl.Content> 
                    <TextBlock Text="Vehículo content"></TextBlock> 
                </Controls:RadFluidContentControl.Content> 
                <Controls:RadFluidContentControl.LargeContent> 
                    <TextBlock Text="Vehículo large"></TextBlock> 
                </Controls:RadFluidContentControl.LargeContent> 
            </Controls:RadFluidContentControl> 
        </NavigationControls:RadTileViewItem.Content> 
    </NavigationControls:RadTileViewItem> 
    <NavigationControls:RadTileViewItem> 
        <NavigationControls:RadTileViewItem.Header> 
            <TextBlock Text="Empresa header"></TextBlock> 
        </NavigationControls:RadTileViewItem.Header> 
        <NavigationControls:RadTileViewItem.Content> 
            <Controls:RadFluidContentControl AnimationControls:AnimationManager.IsAnimationEnabled="True" 
                                             SmallToNormalThreshold="291,130" 
                                             NormalToSmallThreshold="292,131" 
                                             NormalToLargeThreshold="735,350" 
                                             LargeToNormalThreshold="731,351"
                <Controls:RadFluidContentControl.SmallContent> 
                    <TextBlock Text="Empresa small"></TextBlock> 
                </Controls:RadFluidContentControl.SmallContent> 
                <Controls:RadFluidContentControl.Content> 
                    <TextBlock Text="Empresa content"></TextBlock> 
                </Controls:RadFluidContentControl.Content> 
                <Controls:RadFluidContentControl.LargeContent> 
                    <TextBlock Text="Empresa large"></TextBlock> 
                </Controls:RadFluidContentControl.LargeContent> 
            </Controls:RadFluidContentControl> 
        </NavigationControls:RadTileViewItem.Content> 
    </NavigationControls:RadTileViewItem> 
</NavigationControls:RadTileView> 

Could there be anything I'm missing? Thanks.

3 Answers, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 04 Feb 2010, 09:22 AM
Hi Hugo,

I was not able to reproduce the problem you reported. Please take a look at the attached sample project and see if you can modify it to reproduce the error.

Best wishes,
Tihomir Petkov
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
santos
Top achievements
Rank 1
answered on 10 Mar 2010, 11:41 PM
hi:
  I used the tileview in Usercontrol of a project and this run well. but, other project invoke the project first (runtime). And when the usercontrol is opened ( that contain the control tileview). appear the follow exception:

TargetSite       {Void FindRootVisual()}
declarant type {Name = "RadDragAndDropManager" FullName = "Telerik.Windows.Controls.DragDrop.RadDragAndDropManager"}
module            {Telerik.Windows.Controls.dll}

stackTrace:
   en Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.FindRootVisual() en c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDrop\RadDragAndDropManager.cs:línea 995
   en Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.Initialize() en c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDrop\RadDragAndDropManager.cs:línea 524
   en Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.OnAllowDragChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) en c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDrop\RadDragAndDropManager.cs:línea 393
   en System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   en System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   en System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   en System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
   en System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
   en System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   en Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.SetAllowDrag(DependencyObject obj, Boolean value) en c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDrop\RadDragAndDropManager.cs:línea 198
   en Telerik.Windows.Controls.RadTileViewItem.OnApplyTemplate() en c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TileView\RadTileViewItem.cs:línea 180
   en System.Windows.FrameworkElement.ApplyTemplate()

  ....
0
Tihomir Petkov
Telerik team
answered on 11 Mar 2010, 08:17 AM
Hi Santos,

Can you please modify the sample project that I provided so that it reproduces the error? Besides, from the stack trace it seems the problem is not in the TileView control but most probably in the part of your application that uses RadDragAndDropManager. However, without a project that reproduces the error I will not be able to investigate the issue.

Greetings,
Tihomir Petkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TileView
Asked by
Hugo Aristizabal
Top achievements
Rank 2
Answers by
Tihomir Petkov
Telerik team
santos
Top achievements
Rank 1
Share this question
or