creating a custom control that extends the DataGrid control and can be placed on the toolbox problem

W

Wiredless

Hi,

I have created custom controls that i can place on the toolbox for drag and
drop design time development. However, if i try to create a custom control
that inherits from the DataGrid I am not able to add the control to the
toolbox correctly, it appears grayed out. Is there something about the
DataGrid that prevents it from being used as a base class for a custom
control? The class that inherits from the DataGrid only add a few public
methods.

is this doable? Has anyone created a custom control that inherits from
DataGrid and can be placed on the toolbox?

Thanks
 
W

Wiredless

ok this is what i did to try to find the problem.

i created a custom control that inherits from the "Panel" instead of the
DataGrid. i then created my design time control dll. i then added the
control to the toolbox and it worked as expected but again this control
inherits from the Panel not the datagrid...

so then to trick the system i recompiled and recreated the design dll but
now i have it inheritng from the datagrid as i originally wanted.

so the control in on the toolbox still but now it inherits from the
datagrid.

when i try to drop it on the form i get the error "Object type cannot be
converted to target type"

the only thing i can think of is that the datagrid is in its own namespace
System.Windows.Forms.DataGrid not System.Windows.Forms...

to create a custom control design time dll i have to compile the control
against special versions of the System.CF.Windows.Forms.dll,
System.CF.Drawing.DLL and System.CF.Design.dll. Is there a special version
of the System.CF.Windows.Forms.DataGrid dll that i need to build the design
time dll with?


Thanks...
 

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