Last post Dec 01, 2008 01:30 PM by sjnaughton
Nov 28, 2008 06:01 AM|mattbrooks|LINK
Out of the box ASP.NET Dynamic Data works with the GridView and DetailsView to provide its scaffolding functionality. Is it technically possible to leverage Dynamic Data to dynamically generate the control templates for the ListView and FormView controls,
or any other templated databound control? For example the FormView.EditItemTemplate.
One approach I can think of: Using a PlaceHolder control within the template markup and then programatically creating the child control structure (e.g. instances of DynamicControl) from the Dynamic Data meta data. However, the control tree would need to
be rebuilt on each post-back and I think this might cause some issues.
ASP.NET Dynamic Data
Nov 28, 2008 05:55 PM|Evoluteur|LINK
You are right. The re-building on each post-back works but is not ideal (and hurt performances). It becomes especially painfull when you do not need to display the control you re-build but only want to grab the posted values.
I'm working on an alternative with one single control using litteral html instead of child controls. That way I can get much better performance.
My solution is open source, you can check it out at
Nov 28, 2008 06:14 PM|sjnaughton|LINK
Hi Matt, I've done an article on this have a look and see what you think:
You also have the option of loading templates instead of dynamic column generation, a bit like the new Entity Templates [:D].
Nov 29, 2008 11:30 AM|mattbrooks|LINK
Thanks for the info - I actually found your articles on Friday and they were the inspiration for a working proof of concept I knocked together. Unfortunately that is when I made the this observation (1) and found this bug (2). I am going to try and get some
feedback on both before I proceed with Dynamic Data.
Dec 01, 2008 11:24 AM|scothu|LINK
We have a new feature in the next version of Dynamic Data called Entity Templates. These are basically templates that are not at the field level but instead at the object level. Product, Customer, etc including a Dynamically created one. Using these it will
be possible to do scaffolding of say a FormView and we are probably going to replace DetailsView in our default templates with the new FormView offering much richer customization of the details views. Our next preview release to Codeplex will hopefully contain
this update. :-)
Dec 01, 2008 01:30 PM|sjnaughton|LINK
And if you want that now [;)] have alook at my post above on Custom PageTemplate.