PC Review


Reply
Thread Tools Rate Thread

datagridview as part of UserControl - error from designer: object reference not set to....

 
 
Oli
Guest
Posts: n/a
 
      30th Jan 2007
I have written a simple UserControl that consists of a datagridview
and two buttons that control the scrolling of the grid.

All is fine and dandy - .....nearly

The datagridview that's on the UserControl is actually exposed as a
property: "Grid" - this is a quick and dirty (suitable here) way of
allowing access to the Grid properties.

in the designer the "Grid" property shows up ok - however accessing
the "Columns" property within that gives "object reference not set to
an instance of an object".

If I expose the "Columns" property of the underlying grid via a
"Columns" property the UserControl - then this as expected also shows
up in the designer - but still fails (with a different error message
in this case).

Anyone know if there are any issues I should know about when writing a
UserControl that contain a DataGridView??

thanks,
O.

 
Reply With Quote
 
 
 
 
RobinS
Guest
Posts: n/a
 
      31st Jan 2007
Yes. Search the dotnet newsgroups for "Linda Liu" and "DataGridView". There
was some posting last year about this very problem, and there is no
workaround, *IIRC*.

Robin S.
---------------------------------------------------
"Oli" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have written a simple UserControl that consists of a datagridview
> and two buttons that control the scrolling of the grid.
>
> All is fine and dandy - .....nearly
>
> The datagridview that's on the UserControl is actually exposed as a
> property: "Grid" - this is a quick and dirty (suitable here) way of
> allowing access to the Grid properties.
>
> in the designer the "Grid" property shows up ok - however accessing
> the "Columns" property within that gives "object reference not set to
> an instance of an object".
>
> If I expose the "Columns" property of the underlying grid via a
> "Columns" property the UserControl - then this as expected also shows
> up in the designer - but still fails (with a different error message
> in this case).
>
> Anyone know if there are any issues I should know about when writing a
> UserControl that contain a DataGridView??
>
> thanks,
> O.
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert error from designer generated table adapter:object reference not set to.. Rob Microsoft VB .NET 2 3rd Feb 2007 01:52 AM
Object reference error in UserControl's Load event Nathan Sokalski Microsoft VB .NET 1 6th Jan 2007 06:16 PM
Object reference error in UserControl's Load event Nathan Sokalski Microsoft ASP .NET 1 6th Jan 2007 06:16 PM
Error in designer when inheriting from UserControl larclap@yahoo.com Microsoft Dot NET Framework Forms 1 21st Dec 2006 10:14 PM
Object Reference when adding UserControl =?Utf-8?B?U2hhbGxvdHg=?= Microsoft VB .NET 2 6th Dec 2004 02:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:48 AM.