Jarod Posted April 22, 2003 Posted April 22, 2003 Hello Here is my problem. I hav extended the control DataGrid. It is working fine but I have found a strange problem : when I change the property ReadOnly ni design mode (everything is ok in runtime), I have an error. I can change it from False to True, but not from True to False. My error is "not set to an instance of an object". I think that it is a side effect of an overloading I have done but can't find where. As it is working in runtime mode, I can't find my error with debugger unless there is a way to "debug" what's happening in design mode. Does someone has an idea ? Quote Jarod
Moderators Robby Posted April 22, 2003 Moderators Posted April 22, 2003 When you change the ReadOnly state of the DataGrid, is it the same grid, meaning is it still in scope? Quote Visit...Bassic Software
Jarod Posted April 22, 2003 Author Posted April 22, 2003 Yes I can change any property thru the designer (seeing the direct result on the screen) but dealing with ReadOnly give me an error. Doing those same changes in runtime works as it is supposed to change. Quote Jarod
Moderators Robby Posted April 22, 2003 Moderators Posted April 22, 2003 Can you post some of the related code? Quote Visit...Bassic Software
Jarod Posted April 22, 2003 Author Posted April 22, 2003 Ok, however, as the code is nearly 700 lines and as I don't really know which part can be involved, can you give me any mail address where I can send you the complete file ? Quote Jarod
Moderators Robby Posted April 22, 2003 Moderators Posted April 22, 2003 You can Zip the project and post it here. Please delete all binary files before zipping (exe, DLL, etc..) Quote Visit...Bassic Software
Jarod Posted April 22, 2003 Author Posted April 22, 2003 Ok here is a project I made for you to be able to "test" the problem. The form1 just have an instance of my custom DataGrid. I have set the ReadOnly property to True and now can'tchange it to false via the designer Feel free to criticize any part of the code you find weird or written not very correctdatagridtest.zip Quote Jarod
Moderators Robby Posted April 22, 2003 Moderators Posted April 22, 2003 I looked at the code in NotePad (I don't have .NET right now) anyway... What happens when you change the ReadOnly in AdvancedDataGrid.vb ? Quote Visit...Bassic Software
Jarod Posted April 23, 2003 Author Posted April 23, 2003 In the designer, I have a popup appearing saying : "Invalid Property Value" and in teh details section: "Object reference not set to an instance of an object." Quote Jarod
Moderators Robby Posted April 23, 2003 Moderators Posted April 23, 2003 (edited) Not in the designer, using code (at run-time). [edit]fixed typo [/edit] Edited April 23, 2003 by Robby Quote Visit...Bassic Software
Jarod Posted April 23, 2003 Author Posted April 23, 2003 oh... You're right :-S And doing another test, I have found that it is due to the fact that no datasource is present. If I add a dataSource like Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load Me.DataGrid1.DataSource = New DataTable().DefaultView Me.DataGrid1.ReadOnly = False End Sub I don't have the problem. But I still can't see why changing the ReadOnly property can have a problem if no datasource is present.... Still searching... Quote Jarod
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.