I
ian.kemp
I have a base UserControl class - DataModule - to which I have added a
SqlConnection and a DataSet. The idea is that users will build on this
base class, adding their own SqlCommands as needed, but always using
the same connection/dataset (i.e. a simple API). The reason for using a
UserControl, is to allow users to drag-and-drop SqlCommands etc. from
the Toolbox directly onto the design area; they can then select those
objects from the Component Tray and edit their properties.
These subclasses of DataModule will then be placed onto another
UserControl containing a DataGridView, and the user will connect the
DataModule's DataSet to the grid's DataSource. So far, I've got the
above working great.
However, when I drop a DataModule subclass onto a UserControl, the
DataModule is placed on that UserControl's canvas. Because DataModule
itself isn't meant to be used as a visual component, it makes more
sense for it to appear in the Component Tray instead; however, I can't
seem to get this to work. (I've tried the DesignTimeVisible attribute,
as well as others.)
if so, is there any way to work around this?
Also, if you think this implementation is incorrect, please tell me!
(I am using .NET 2.0 with Visual Studio 2005 Professional.)
TIA.
SqlConnection and a DataSet. The idea is that users will build on this
base class, adding their own SqlCommands as needed, but always using
the same connection/dataset (i.e. a simple API). The reason for using a
UserControl, is to allow users to drag-and-drop SqlCommands etc. from
the Toolbox directly onto the design area; they can then select those
objects from the Component Tray and edit their properties.
These subclasses of DataModule will then be placed onto another
UserControl containing a DataGridView, and the user will connect the
DataModule's DataSet to the grid's DataSource. So far, I've got the
above working great.
However, when I drop a DataModule subclass onto a UserControl, the
DataModule is placed on that UserControl's canvas. Because DataModule
itself isn't meant to be used as a visual component, it makes more
sense for it to appear in the Component Tray instead; however, I can't
seem to get this to work. (I've tried the DesignTimeVisible attribute,
as well as others.)
Control cannot be displayed in the Component Tray. Is this correct, andFrom what I've read, it seems that any component that's a subclass of
if so, is there any way to work around this?
Also, if you think this implementation is incorrect, please tell me!
(I am using .NET 2.0 with Visual Studio 2005 Professional.)
TIA.