Hi
When I exit my app, I need to reset some of the properties of my ultra gird, but I sometime when I try to set the DispalyLayout.ColumnChooserEnabled property of the UltraGrid to false, it will give me a null reference exception.
I found out that the exception is cause by the DispalyLayout is null, can anyone tell me why the DispalyLayout has become null when the UltraGrid object still valid.
Regards,Stephen
Hi Stephen,
The DisplayLayout on the grid should never be null, unless perhaps the grid is in the process of, or has already been, disposed.
Are you sure about that Mike? I keep getting a null reference for it as well, no matter where I access it. Bug?
I'm certain of it. The DisplayLayout is created in the grid's constructor. So under normal circumstances, it should not be possible for it to return null.
If the DisplayLayout is returning null, then something is seriously wrong. The only ways I can think of that this might possibly occur is if you are using multiple threads and you are trying to access the problem from another thread without properly marshalling the call. Or if you are deriving your own class from UltraGridBase and you are attempting to access something in the grid before the base class constructor has been called.