Designer tries to write to read-only VisibleColumnCount property of DataGrid 
Author Message
 Designer tries to write to read-only VisibleColumnCount property of DataGrid

I am inheriting a datagrid from a base form class.  The Modifiers
property of the DataGrid is set as protected and when I try to
Build...I get the following build error:

Property 'VisibleColumnCount' is 'ReadOnly'

and here is the line with the error:

Me.dgResults.VisibleColumnCount = 9

The funny thing is...I erase or comment out this line and the code
builds and executes just fine.  However, if I do any modifications to
the datagrid or the form it is on, the designer adds the same line and
I get the build error again.

I saw a similar post in the microsoft.public.dotnet.languages.CSharp
group but with a very poor answer (have you accidentally deleted the
datagrid, or something like that).  In any event, any help would be
appreciated.



Sat, 23 Apr 2005 06:18:43 GMT  
 Designer tries to write to read-only VisibleColumnCount property of DataGrid
Hi,
I had the same problem too, but I was only testing, I commented out the code
and everything worked fine.
I didn't do any other testing, but have you tried to change the modifiers to
'Friend' or 'Public'?
Antonio



Quote:
> I am inheriting a datagrid from a base form class.  The Modifiers
> property of the DataGrid is set as protected and when I try to
> Build...I get the following build error:

> Property 'VisibleColumnCount' is 'ReadOnly'

> and here is the line with the error:

> Me.dgResults.VisibleColumnCount = 9

> The funny thing is...I erase or comment out this line and the code
> builds and executes just fine.  However, if I do any modifications to
> the datagrid or the form it is on, the designer adds the same line and
> I get the build error again.

> I saw a similar post in the microsoft.public.dotnet.languages.csharp
> group but with a very poor answer (have you accidentally deleted the
> datagrid, or something like that).  In any event, any help would be
> appreciated.



Sat, 23 Apr 2005 23:24:31 GMT  
 Designer tries to write to read-only VisibleColumnCount property of DataGrid
Yep...I tried changing the modifier to both friend and public without
any luck. I've since given up on inheriting the form with the data
grid but am still looking for an answer to this.  Thanks
Quote:

> Hi,
> I had the same problem too, but I was only testing, I commented out the code
> and everything worked fine.
> I didn't do any other testing, but have you tried to change the modifiers to
> 'Friend' or 'Public'?
> Antonio



Wed, 27 Apr 2005 05:10:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Accessing a Property through read-only and read-write interfaces

2. File Properties - Summary Tab - Read and Write Properties

3. Help trying to write code to change table type properties

4. trying to learn how to read and write to ini files

5. trying to read a MASTER custom property from vb

6. How: Public Read Only / Private Write Property?

7. ReadOnly Property weirdness in Datagrid?

8. Read-only and Write-only Properties

9. Writing a VBS file which reads and writes to the registry

10. Qbasic: Pre-written INI read/write routines?

11. read write error when attempting to write to dbo_tblCounts (Access linked table)

12. Converting returned of a select query to read/write from read-only

 

 
Powered by phpBB® Forum Software