PC Review


Reply
Thread Tools Rate Thread

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

 
 
Wiredless
Guest
Posts: n/a
 
      2nd Jun 2005
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


 
Reply With Quote
 
 
 
 
Daniel Moth
Guest
Posts: n/a
 
      2nd Jun 2005
I am far from being an expert on this and have not created a custom control
inheriting from datagrid.

I would like to point you to the definitive reference on custom
controls/components with designer support:
http://www.peterfoot.net/ControlAndC...esignTime.aspx

Also for someone to help with your issue they probably want to see the code
you tried and failed e.g. a link to it or just paste it in a post

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Wiredless" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
>


 
Reply With Quote
 
Wiredless
Guest
Posts: n/a
 
      2nd Jun 2005
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...

"Daniel Moth" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am far from being an expert on this and have not created a custom control
>inheriting from datagrid.
>
> I would like to point you to the definitive reference on custom
> controls/components with designer support:
> http://www.peterfoot.net/ControlAndC...esignTime.aspx
>
> Also for someone to help with your issue they probably want to see the
> code you tried and failed e.g. a link to it or just paste it in a post
>
> Cheers
> Daniel
> --
> http://www.danielmoth.com/Blog/
>
>
> "Wiredless" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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
>>

>



 
Reply With Quote
 
Sergey Bogdanov
Guest
Posts: n/a
 
      3rd Jun 2005
See this thread:
http://groups-beta.google.com/group/...10ea8872a4389b

--
Sergey Bogdanov
http://www.sergeybogdanov.com


Wiredless wrote:
> 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...
>
> "Daniel Moth" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>>I am far from being an expert on this and have not created a custom control
>>inheriting from datagrid.
>>
>>I would like to point you to the definitive reference on custom
>>controls/components with designer support:
>>http://www.peterfoot.net/ControlAndC...esignTime.aspx
>>
>>Also for someone to help with your issue they probably want to see the
>>code you tried and failed e.g. a link to it or just paste it in a post
>>
>>Cheers
>>Daniel
>>--
>>http://www.danielmoth.com/Blog/
>>
>>
>>"Wiredless" <(E-Mail Removed)> wrote in message
>>news:%(E-Mail Removed)...
>>
>>>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
>>>

>>

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set Custom Control Toolbox icon from existing control? jhardman2006@yahoo.co.nz Microsoft Dot NET Compact Framework 0 30th Oct 2007 09:07 AM
How to put a Custom Control on the toolbox. craigkenisston@hotmail.com Microsoft ASP .NET 5 30th Sep 2006 11:06 PM
Problem: Control Toolbox Control resizes when clicked =?Utf-8?B?RWQ=?= Microsoft Excel Programming 1 27th Jul 2005 07:55 AM
problem with custom control and toolbox Daniel Billingsley Microsoft Dot NET Framework 0 4th Aug 2004 10:49 PM
DataGrid Custom Child Control Problem Glenn Owens Microsoft ASP .NET 1 8th Jul 2004 02:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:35 PM.