I’m trying to create a user control that allows users to make something like the following:
<uc1:MyControl id='controlThing' runat='server'> <uc1:BoundColumn id='column1' Column='Name' runat='server' /> <uc1:CheckBoxBoundColumn id='column2' Column='Selector' runat='server' /> <uc1:BoundColumn id='column3' Column='Description' runat='server' /> ...etc </uc1:MyControl>
There are only certain controls I would allow, in addition to the fact that you can have many of any type. I can picture this in XSD, but I’m not entirely sure for ASP.NET.
My ASP.NET voodoo is drawing a blank right now.. any thoughts?
The PersistenceMode.InnerProperty is what you want.. Here are the MSDN docs. Doing something like this will get you what you want:
and then you’ll be able to use it like this:
You can create your own custom classes to use in there as well.