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

System.NullReferenceException

1 Answer 57 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
Russell
Top achievements
Rank 1
Russell asked on 26 Nov 2017, 07:53 AM

Hi,

I am testing DataGrid for my first mobile app.  

If I set AutoGenerateColumns="True" then everything works great.

But if I try to manually create the columns in xaml, my app crashes in iOS.  I get an System.NullReferenceException on the "AppDelegate" line in main.cs.   I know I am setting the grid.ItemsSource to a valid List because AutoGenerateColumns is showing them.

Any ideas?

1 Answer, 1 is accepted

Sort by
0
Russell
Top achievements
Rank 1
answered on 26 Nov 2017, 09:16 PM
Please ignore.  I was using the single line grid creation in xaml and when I switched to defining my own columns, I did not remove the / from the /> and so my grid didnt exist after this line.  doh!
Tags
DataGrid
Asked by
Russell
Top achievements
Rank 1
Answers by
Russell
Top achievements
Rank 1
Share this question
or