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

O

Oli

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

RobinS

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top