Dynamic Data Scaffolding and ListView / FormView

Last post 12-01-2008 1:30 PM by sjnaughton. 5 replies.

Sort Posts:

  • Dynamic Data Scaffolding and ListView / FormView

    11-28-2008, 6:01 AM
    • Member
      28 point Member
    • mattbrooks
    • Member since 06-17-2004, 1:58 PM
    • Posts 25

    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.

  • Re: Dynamic Data Scaffolding and ListView / FormView

    11-28-2008, 5:55 PM
    • Member
      56 point Member
    • Evoluteur
    • Member since 11-28-2008, 10:45 PM
    • Posts 5

    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

     

  • Re: Dynamic Data Scaffolding and ListView / FormView

    11-28-2008, 6:14 PM
    • Star
      12,328 point Star
    • sjnaughton
    • Member since 04-29-2008, 1:11 PM
    • Newton-le-Willows, Merseyside, UK
    • Posts 2,567
    • TrustedFriends-MVPs

    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 Big Smile.

    Steve Big Smile

    Always seeking an elegant solution.
    [Oh! If olny I colud tpye!]
    c# Bits blog
    Oh, and don't forget to mark as answer any posts that help you Big Smile
  • Re: Dynamic Data Scaffolding and ListView / FormView

    11-29-2008, 11:30 AM
    • Member
      28 point Member
    • mattbrooks
    • Member since 06-17-2004, 1:58 PM
    • Posts 25

    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

     

  • Re: Dynamic Data Scaffolding and ListView / FormView

    12-01-2008, 11:24 AM
    • Participant
      1,320 point Participant
    • scothu
    • Member since 12-10-2007, 6:54 AM
    • Redmond, WA
    • Posts 272
    • AspNetTeam
      Moderator

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

    Scott Hunter
    PM, ASP.NET Team, Microsoft
  • Re: Dynamic Data Scaffolding and ListView / FormView

    12-01-2008, 1:30 PM
    • Star
      12,328 point Star
    • sjnaughton
    • Member since 04-29-2008, 1:11 PM
    • Newton-le-Willows, Merseyside, UK
    • Posts 2,567
    • TrustedFriends-MVPs

    And if you want that now Wink have alook at my post above on Custom PageTemplate.

    Steve Big Smile

    Always seeking an elegant solution.
    [Oh! If olny I colud tpye!]
    c# Bits blog
    Oh, and don't forget to mark as answer any posts that help you Big Smile
Page 1 of 1 (6 items)