I have a WPF project with a main Window
and a UserControl
.
In the Usercontrol
I set a GridControl.ItemsSource
using gridcontrol.ItemsSource = query.tolist()
, but when loading the Usercontrol
it throws an Exception
:
"The object reference not set to an object"
In spite of the query returning 40 rows of data.
The code is executed in the MainWindow but the UserControl
throws the exception.