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

GridViewDataControl Exception Internal Build

4 Answers 56 Views
GridView
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 03 Apr 2010, 05:03 AM
Hello,

I am getting the following exception with the latest internal build (and also the previous build) :

Line: 54
Error: Unhandled Error in Silverlight Application
Code: 4004   
Category: ManagedRuntimeError      
Message: System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnApplyTemplate()
   at System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)
    

The last internal build that does not have this exception is 2009.3.19

Any ideas?

James

4 Answers, 1 is accepted

Sort by
0
James
Top achievements
Rank 1
answered on 03 Apr 2010, 05:15 AM
That was a mistake, I meant 2010.3.19 was the last version that worked without an exception.
0
Rossen Hristov
Telerik team
answered on 05 Apr 2010, 02:02 PM
Hi James,

Please, open a support ticket and send us your project. We cannot guess what is going on without having anything to look at. Thanks in advance.

All the best,
Ross
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.
0
James
Top achievements
Rank 1
answered on 14 Apr 2010, 08:37 AM
Hi,

I have found the problem - there appears to be a dependency on element "PART_GroupPanel" that did not exist before.

Please see my template below - if I remove the PART_GroupPanel element then I get the above exception. My work around is to make it collapsed, but ideally I don't want to include elements that are of no use to me, so I can optimize performance.

Are you able to replicate?

James

    <ControlTemplate x:Key="GridViewTemplate" TargetType="Controls:RadGridView">  
        <Border x:Name="PART_MasterGridContainer"   
                BorderBrush="{TemplateBinding BorderBrush}"   
                BorderThickness="{TemplateBinding BorderThickness}">  
            <Grid x:Name="HierrarchyBackground" Background="{TemplateBinding Background}">  
                <Grid.ColumnDefinitions> 
                    <ColumnDefinition/> 
                    <ColumnDefinition x:Name="ScrollBarColumn" MinWidth="0" Width="0"/>  
                </Grid.ColumnDefinitions> 
                <Grid.RowDefinitions> 
                    <RowDefinition/> 
                    <RowDefinition x:Name="ScrollBarRow" Height="0" MinHeight="0"/>  
                </Grid.RowDefinitions> 
                <Telerik_Windows_Controls_GridView:GridViewGroupPanel x:Name="PART_GroupPanel" Visibility="Collapsed" /> 
                <Telerik_Windows_Controls_GridView:GridViewScrollViewer x:Name="PART_ItemsScrollViewer"   
                                                                        Background="Transparent"   
                                                                        Grid.ColumnSpan="2"   
                                                                        Grid.RowSpan="2"   
                                                                        Style="{StaticResource GridViewScrollViewerStyle}" 
                                                                        CanContentScroll="True">  
                    <Telerik_Windows_Controls_GridView:GridViewScrollViewer.HeaderRow> 
                        <Telerik_Windows_Controls_GridView:GridViewHeaderRow x:Name="PART_HeaderRow" IndentLevel="{TemplateBinding GroupCount}"/>  
                    </Telerik_Windows_Controls_GridView:GridViewScrollViewer.HeaderRow> 
                    <Telerik_Windows_Controls_GridView:GridViewVirtualizingPanel x:Name="PART_GridViewVirtualizingPanel"/>  
                </Telerik_Windows_Controls_GridView:GridViewScrollViewer> 
            </Grid> 
        </Border> 
    </ControlTemplate> 
0
Rossen Hristov
Telerik team
answered on 14 Apr 2010, 09:50 AM
Hello James,

We are looking for this part from our code-behind. Please, do not remove it. Simply hide it.

We will think about changing our code to simply go on if it does not find some part.

I hope this helps.

All the best,
Ross
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
GridView
Asked by
James
Top achievements
Rank 1
Answers by
James
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or