FIX: Cannot Reset ReadOnly Property of DataGrid to False (308899)



The information in this article applies to:

  • Microsoft .NET Framework

This article was previously published under Q308899

SYMPTOMS

At design time or at run time, if you change the ReadOnly property of the DataGrid control from True to False, you may receive the following error message:
Invalid Property Value
When you click Details, you receive the following error message:
Object reference not set to an instance of an object.

RESOLUTION

To resolve this problem, set the DataSource property of the DataGrid control before you set the ReadOnly property.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Microsoft .NET Framework 1.1.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open Visual Studio .NET.
  2. Create a new Windows Application project in Microsoft Visual Basic .NET. Form1 is added to the project by default.
  3. Add a DataGrid control to Form1.
  4. Set the ReadOnly property for the DataGrid to True.
  5. Change the ReadOnly property for the DataGrid to False. You receive the above-mentioned error message.

Modification Type:MinorLast Reviewed:3/20/2003
Keywords:kbfix kbbug kbpending KB308899