对象引用未设置为主详细信息屏幕中对象的实例 [英] Object reference not set to an instance of an object in a Master Detail Screen
问题描述
我创建了一个包含三个相关实体A,B,C的主详细信息屏幕.A是B的主人,B是C的主人。对于B和C,使用DataGrid。
I have created a master detail screen with three related entities A, B, C. A is master for B, B is master for C. For B and C a DataGrid is uses.
运行应用程序,显示屏幕,整个屏幕快速冻结,使用十字图标关闭屏幕,等待几秒钟,并且"对象引用未设置为对象的实例"。被展示。再次打开屏幕,从现在开始一切都很好。
on。
Run the app, display the screen, the entire screen freezes quickly, close the screen using cross icon, wait for some seconds, and "Object reference not set to an instance of an object" is displayed. Open the screen again and all things are fine from now on.
解决问题的任何提示?
推荐答案
设置Debug / Exceptions / CommonLanguageRuntime / Thrown并检查它。 然后跑。 它应该打破违规代码。 在检查
parent上的任何属性之前,请确保引用父对象的任何代码首先在父实体上检查null。
Set Debug/Exceptions/CommonLanguageRuntime/Thrown and check it. Then run. It should break on the offending code. Make sure any code refering to a parent object is checking for null on parent entity first before checking any properties on parent.
这篇关于对象引用未设置为主详细信息屏幕中对象的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!