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

Add Record NullReferenceException

1 Answer 99 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Murray
Top achievements
Rank 1
Murray asked on 13 Jun 2012, 05:36 AM
Hi

I am trying to add a new record to a grid using the inbuilt ShowInsertRow. When I add the record I get binding errors and an exception A first chance exception of type 'System.NullReferenceException' occurred in Telerik.Windows.Data.dll

If I continue through the errors it adds the record to the grid correctly.

The grid is bound to a ObservableCollection in the view model

<telerik:RadGridView Grid.Row="2" x:Name="SpatialDataLocations"
                                        ItemsSource="{Binding SpatialDataLocations}"
                                        ShowGroupPanel="False"
                                        ShowInsertRow="True"
                                        IsSynchronizedWithCurrentItem="True"
                                        VerticalAlignment="Stretch"
                                        HorizontalAlignment="Stretch"
                                        AutoGenerateColumns="False"
                                        CanUserInsertRows="True">
                       <telerik:RadGridView.Columns>
                           <telerik:GridViewDataColumn Header="Name"
                                                       DataMemberBinding="{Binding Name, Mode=TwoWay}" />
                           <telerik:GridViewDataColumn Header="Path"
                                                       DataMemberBinding="{Binding Path, Mode=TwoWay}" />
                       </telerik:RadGridView.Columns>
                   </telerik:RadGridView>


I get two exceptions one for each column. The Call Stack Location is Telerik.Windows.Data.ObjectDataBinder.GetValue(Object bindingSource, stringPropertyPath)

The binding source is null, is this the problem? If so how do I deal with this?

Thanks for you help

Regards

Murray

1 Answer, 1 is accepted

Sort by
0
Murray
Top achievements
Rank 1
answered on 13 Jun 2012, 06:08 AM
This issue has now mysteriously disappeared.

Tags
GridView
Asked by
Murray
Top achievements
Rank 1
Answers by
Murray
Top achievements
Rank 1
Share this question
or