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.
RobinS - 31 Jan 2007 08:18 GMT
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.
---------------------------------------------------
>I have written a simple UserControl that consists of a datagridview
> and two buttons that control the scrolling of the grid.
[quoted text clipped - 19 lines]
> thanks,
> O.