"Debug" in design mode ?

Jarod

Well-known member
Joined
Feb 5, 2003
Messages
82
Location
Bruxelles
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 cant find where.
As it is working in runtime mode, I cant find my error with debugger unless there is a way to "debug" whats happening in design mode.
Does someone has an idea ?
 
When you change the ReadOnly state of the DataGrid, is it the same grid, meaning is it still in scope?
 
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.
 
Ok, however, as the code is nearly 700 lines and as I dont really know which part can be involved, can you give me any mail address where I can send you the complete file ?
 
You can Zip the project and post it here.

Please delete all binary files before zipping (exe, DLL, etc..)
 
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 cantchange it to false via the designer

Feel free to criticize any part of the code you find weird or written not very correct
 

Attachments

I looked at the code in NotePad (I dont have .NET right now) anyway...

What happens when you change the ReadOnly in AdvancedDataGrid.vb ?
 
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."
 
Not in the designer, using code (at run-time).

[edit]fixed typo [/edit]
 
Last edited by a moderator:
oh...
Youre 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
Code:
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 dont have the problem.
But I still cant see why changing the ReadOnly property can have a problem if no datasource is present....
Still searching...
 
Back
Top