DataGrid Subclass

G

Guest

Hi All,

I know that this question has been asked and I have found the thread that
discusses the solution but was not able to get the code for the fix.
I have subclassed a grid control and it all works great in runtime mode but
when add to the toolbox it is just grayed out. I added the following code
#if DESIGN

[ToolboxItemFilter("NETCF",ToolboxItemFilterType.Require),

ToolboxItemFilter("System.CF.Windows.Forms.DataGrid",
ToolboxItemFilterType.Custom)]

#endif

which enabled the control in the toolbox but when I added the control to a
form it went to the toolbar like a menu bar instead of displaying like a
normal grid object.
Any ideas please?

Thanks,
Chris.
 
G

Guest

Thanks Tim...

I had an existing controls project that had already included the desktop
Forms dll and forgot to remove that before adding the CF version of the
DataGrid DLL.
Damn, wasted a day on that!

Cheers,

Tim Wilson said:
The attributes that you've added are for Components. You need to specify the
RuntimeAssemblyAttribute for a Control. Here's some more information.
http://msdn.microsoft.com/library/d..._evtuv/html/etconcustomcontroldevelopment.asp
http://msdn.microsoft.com/library/d...ngCustomControlForSmartDeviceApplications.asp

--
Tim Wilson
..Net Compact Framework MVP

Chris said:
Hi All,

I know that this question has been asked and I have found the thread that
discusses the solution but was not able to get the code for the fix.
I have subclassed a grid control and it all works great in runtime mode but
when add to the toolbox it is just grayed out. I added the following code
#if DESIGN

[ToolboxItemFilter("NETCF",ToolboxItemFilterType.Require),

ToolboxItemFilter("System.CF.Windows.Forms.DataGrid",
ToolboxItemFilterType.Custom)]

#endif

which enabled the control in the toolbox but when I added the control to a
form it went to the toolbar like a menu bar instead of displaying like a
normal grid object.
Any ideas please?

Thanks,
Chris.
 

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