Nested Controls within a nested control
-
I already know how to nest webcontrols in another webcontrol, as in a listbox, I also know how to nest controls in those nested controls, so you will get something like this:
<cc1:MyOwnThreadedControl ID=”threadcontrol1”> <cc1:Thread ID=”thread1”> <cc1:Thread ID=”thread1a”> <cc1:Thread ID=”thread1b”> </cc1:Thread> <cc1:Thread ID=”thread2”> </cc1:Thread> <cc1:Thread ID=”thread3”> </cc1:Thread> </cc1:MyOwnThreadedControl>
There is only one problem, in the Visual Studio .NET designer I can’t find a way to display those “Threads” in the Component screen, as is done with components as Process, Timer and MessageQueue for example. Both MyOwnThreadedControl and Thread are inherited from WebControl and INamingContainer, use a ControlBuilder, etcetera… Is there an attribute I’ve to set to let VS.NET know it has to be displayed as component, or if possible as a control, inside the other? Sjoerd van Leent LPCTSTR Dutch = TEXT("Double Dutch :-)");
-
I already know how to nest webcontrols in another webcontrol, as in a listbox, I also know how to nest controls in those nested controls, so you will get something like this:
<cc1:MyOwnThreadedControl ID=”threadcontrol1”> <cc1:Thread ID=”thread1”> <cc1:Thread ID=”thread1a”> <cc1:Thread ID=”thread1b”> </cc1:Thread> <cc1:Thread ID=”thread2”> </cc1:Thread> <cc1:Thread ID=”thread3”> </cc1:Thread> </cc1:MyOwnThreadedControl>
There is only one problem, in the Visual Studio .NET designer I can’t find a way to display those “Threads” in the Component screen, as is done with components as Process, Timer and MessageQueue for example. Both MyOwnThreadedControl and Thread are inherited from WebControl and INamingContainer, use a ControlBuilder, etcetera… Is there an attribute I’ve to set to let VS.NET know it has to be displayed as component, or if possible as a control, inside the other? Sjoerd van Leent LPCTSTR Dutch = TEXT("Double Dutch :-)");
Just a thought, but if the thread are in a table and the table has no text inside it, it wont show. Do they indeed have some dummy text inside of them? If I remmeber correctly MSDN states that you should created a dummy datasource and set that when the control in design time. So, in you render method add something like this:
if (Site!=null && Site.DesignMode)
{
//setup dummy data
}
//continue with normal rendering.Hope this helps :) DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET
-
Just a thought, but if the thread are in a table and the table has no text inside it, it wont show. Do they indeed have some dummy text inside of them? If I remmeber correctly MSDN states that you should created a dummy datasource and set that when the control in design time. So, in you render method add something like this:
if (Site!=null && Site.DesignMode)
{
//setup dummy data
}
//continue with normal rendering.Hope this helps :) DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET
That's not what I meant, it's not that it isn't displayed, but I want my components (the threads) in the Component area of the Webforms editor, so I can click on them, and set the properties of the items. Sjoerd van Leent LPCTSTR Dutch = TEXT("Double Dutch :-)");
-
That's not what I meant, it's not that it isn't displayed, but I want my components (the threads) in the Component area of the Webforms editor, so I can click on them, and set the properties of the items. Sjoerd van Leent LPCTSTR Dutch = TEXT("Double Dutch :-)");
Thats NOT possible with nested controls. See for yourself add atextbox to a table cell and there noway you can set the properties via the Designer, you need to edit them directly in the HTML. DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET