P
Praveen Ramesh
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:
cSelect = 1, System.Object[] objects = {Length=1}, int flags = 2) + 0xcd
bytes
microsoft.vsdesigner.dll!Microsoft.VSDesigner.WebForms.WebFormSelectionContainer.SetSelectedObjects(System.Object[]
objects = {Length=1}) + 0x4f bytes
microsoft.vsdesigner.dll!Microsoft.VSDesigner.WebForms.WebFormDesigner.System.Drawing.Design.IToolboxUser.ToolPicked(System.Drawing.Design.ToolboxItem
tool = {MyNamespace.MyToolBoxItem}) + 0x268 bytes
microsoft.vsdesigner.dll!Microsoft.VSDesigner.WebForms.WebFormDesigner.Microsoft.VSDesigner.Interop.IWebFormDesigner.OnDragDrop(System.Object
pDO =
{Microsoft.VisualStudio.Designer.Service.ToolboxService.ToolboxDataObject},
bool fNonVisualComponent = true) + 0x52 bytes
Any ideas, anybody?
Thanks in advance
-Praveen
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.WebForms.WebFormSelectionContainer.SelectObjects(intmicrosoft.vsdesigner.dll!Microsoft.VSDesigner.WebForms.WebFormSelectionContainer.SelectDelegateObjects(System.Object[]
objects) + 0x127 bytes
cSelect = 1, System.Object[] objects = {Length=1}, int flags = 2) + 0xcd
bytes
microsoft.vsdesigner.dll!Microsoft.VSDesigner.WebForms.WebFormSelectionContainer.SetSelectedObjects(System.Object[]
objects = {Length=1}) + 0x4f bytes
microsoft.vsdesigner.dll!Microsoft.VSDesigner.WebForms.WebFormDesigner.System.Drawing.Design.IToolboxUser.ToolPicked(System.Drawing.Design.ToolboxItem
tool = {MyNamespace.MyToolBoxItem}) + 0x268 bytes
microsoft.vsdesigner.dll!Microsoft.VSDesigner.WebForms.WebFormDesigner.Microsoft.VSDesigner.Interop.IWebFormDesigner.OnDragDrop(System.Object
pDO =
{Microsoft.VisualStudio.Designer.Service.ToolboxService.ToolboxDataObject},
bool fNonVisualComponent = true) + 0x52 bytes
Any ideas, anybody?
Thanks in advance
-Praveen