locked
Dynamic Data Scaffolding and ListView / FormView RRS feed

  • Question

  • User645151313 posted

    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.

    Friday, November 28, 2008 6:01 AM

All replies

  • User1787105854 posted

    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 http://www.evolutility.org

     

    Friday, November 28, 2008 5:55 PM
  • User-330204900 posted

    Hi Matt, I've done an article on this have a look and see what you think:

    1. Custom PageTemplates Part 1 - Custom PageTemplates with Ajax Control Toolkit Tabs
    2. Custom PageTemplates Part 2 - A variation of Part 1 with the Details and SubGrid in Tabs
    3. Custom PageTemplates Part 3 - Dynamic/Templated Grid with Insert (Using ListView)
    4. Custom PageTemplates Part 4 - Dynamic/Templated FromView

    You also have the option of loading templates instead of dynamic column generation, a bit like the new Entity Templates [:D].

    Friday, November 28, 2008 6:14 PM
  • User645151313 posted

    Stephen,

    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.

    (1) http://forums.asp.net/t/1354267.aspx
    (2) http://forums.asp.net/t/1354287.aspx

     

    Saturday, November 29, 2008 11:30 AM
  • User660823006 posted

    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. :-)

    Monday, December 1, 2008 11:24 AM
  • User-330204900 posted

    And if you want that now [;)] have alook at my post above on Custom PageTemplate.

    Monday, December 1, 2008 1:30 PM