I've been thinking about this over the weekend, so I'm sorry I haven't chimed in before now.
I haven't tried this, but I discovered some code in the Charity SDK sample initialization script (Global.asax) that demonstrates initializing an EventsView control and assigning it to a template:
var eventsControl =
eventsControl.ControlDefinition.GetDefaultDetailView().TemplateKey = SampleUtilities.GetControlTemplateKey(
"Event Details with iCal"
I believe the key is the ControlDefinition.GetDefaultDetailView()
which also exposes a TemplatePath
This should allow you to set the template programmatically when adding a new widget to the page.
This isn't a complete soluion, and I will continue to spend some time on this to get a working sample, but I hope that this helps to point you in the right direction in the meantime!