473,385 Members | 1,641 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,385 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 1421
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.