473,408 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Custom ToolBoxItem type:

Hi,

I have derived from the base ToolBoxItem type as follows (it does nothing, I
just want to get things working for now):
[Serializable()]

public class MyToolBoxItem : ToolboxItem

{

public MyToolBoxItem() : base() {}

public MyToolBoxItem(Type toolType):base(toolType){}

private MyToolBoxItem(SerializationInfo info, StreamingContext context)

: base(typeof(GridGroupingControl))

{

Deserialize(info, context);

}

}

And use the above type in my custom control as follows:

[ToolboxItem(typeof(MyToolBoxItem ))]

public class MyWebControl : System.Web.UI.WebControls.WebControl{...}

But when I drag and drop this control on a page nothing happens! I see that
the corresponding assemblies are added to the assemblies reference in the
project, but the control itself is not getting added to the page.

In debug mode, I see that a null reference exception occurs at the following
call stack:

microsoft.vsdesigner.dll!Microsoft.VSDesigner.WebF orms.WebFormSelectionContainer.SelectDelegateObjec ts(System.Object[]
objects) + 0x127 bytes

microsoft.vsdesigner.dll!Microsoft.VSDesigner.WebF orms.WebFormSelectionContainer.SelectObjects(int
cSelect = 1, System.Object[] objects = {Length=1}, int flags = 2) + 0xcd
bytes
microsoft.vsdesigner.dll!Microsoft.VSDesigner.WebF orms.WebFormSelectionContainer.SetSelectedObjects( System.Object[]
objects = {Length=1}) + 0x4f bytes
microsoft.vsdesigner.dll!Microsoft.VSDesigner.WebF orms.WebFormDesigner.System.Drawing.Design.IToolbo xUser.ToolPicked(System.Drawing.Design.ToolboxItem
tool = {MyNamespace.MyToolBoxItem}) + 0x268 bytes
microsoft.vsdesigner.dll!Microsoft.VSDesigner.WebF orms.WebFormDesigner.Microsoft.VSDesigner.Interop. IWebFormDesigner.OnDragDrop(System.Object
pDO =
{Microsoft.VisualStudio.Designer.Service.ToolboxSe rvice.ToolboxDataObject},
bool fNonVisualComponent = true) + 0x52 bytes

Any ideas, anybody?

Thanks in advance

-Praveen
Nov 19 '05 #1
5 1423
Hi Praveen,

Thanks for your posting. Regarding on this issue, I've also noticed your
another post discussing on the similiar problem in this group. In that
thread you're dealing with the problem of not found assembly , yes? This
sometimes occur when the control or components has dependency assemblies
and we can programmatcly add reference in control/component's design-time
code through ToolboxItem.

I'm not sure whether this is cause of the problem in this thread? From the
code snippet you attached and the description, I'm thinking the problem
likely concern to the ToolboxItem you applied on your control. Will the
control be added onto page correctly if you remove the ToolboxItem for it?
If so, we may do some further troubleshoot on the ToolboxItem's code.

Also, if you feel convenient, would you send me a simplified version of
your control and toolboxitem so that I can have a try on my side?

Please feel free to post here if there is anything I can assist. Thanks,
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 19 '05 #2
Hi Praveen,

Thanks for your posting. Regarding on this issue, I've also noticed your
another post discussing on the similiar problem in this group. In that
thread you're dealing with the problem of not found assembly , yes? This
sometimes occur when the control or components has dependency assemblies
and we can programmatcly add reference in control/component's design-time
code through ToolboxItem.

I'm not sure whether this is cause of the problem in this thread? From the
code snippet you attached and the description, I'm thinking the problem
likely concern to the ToolboxItem you applied on your control. Will the
control be added onto page correctly if you remove the ToolboxItem for it?
If so, we may do some further troubleshoot on the ToolboxItem's code.

Also, if you feel convenient, would you send me a simplified version of
your control and toolboxitem so that I can have a try on my side?

Please feel free to post here if there is anything I can assist. Thanks,
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 19 '05 #3
Steven,

Let us discus this issue in the other thread.

Thanks
Praveen
Nov 19 '05 #4
Thanks for your followup.

I'll post my response in that thread.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #5
For the group:
If you instead derive from WebControlToolboxItem, everything works as
expected.

"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:Np**************@TK2MSFTNGXA02.phx.gbl...
Thanks for your followup.

I'll post my response in that thread.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Praveen Ramesh | last post by:
Hi, I have derived from the base ToolBoxItem type as follows (it does nothing, I just want to get things working for now): public class MyToolBoxItem : ToolboxItem {
2
by: S. Justin Gengo | last post by:
Hi, I've created a component that allows me to store database information for various types of databases my company uses. It uses a collection for each type of database. Everything is working...
5
by: ToddH | last post by:
I know the following code is C#. I'm a vb programmer trying to learn a new language. I posted this in the c# group but never got a response. You guys seem to know alot about all languages and have...
0
by: Jeremy Chapman | last post by:
I have included below virtually all the code to a control I'm trying to build. My issue is that an array list property in my control does not get persisted properly to the aspx page code in design...
3
by: hassan | last post by:
Hi, I have develope a custom component i want this component as private member of parent form but i can't. My component declared in InitializeControls() function of designer.Thanx in advance for...
5
by: jerem22 | last post by:
Hi there, In my application, I would like to use a custom ListView control. In order to do that, I've created a new class that inherit ListView and basically looks like this : class...
0
by: R.A.F. | last post by:
Hi, I wrote a little app which should add on Toolbox palette my custom controls. however, it does not work. it creates well my TAB with my custom name, but it does not add my custom control....
1
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi all, misters, I have a custom web control, and I want use it in my main user control ASCX. My webcontrol has one event, see source code above /// <summary>Control DropDownExtender para...
2
by: Just Me | last post by:
I want a Base Class to derive my other web controls from, but I dont want it to appear in the toolbox, I think there must be a class attribute for this, can anyone tell me the exact syntax I need...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.