Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 ?

Jarod
Posted

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.

Jarod
Posted
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 ?
Jarod
Posted

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 correct

datagridtest.zip

Jarod
Posted

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."

Jarod
Posted

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...

Jarod

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...