Modify default (1 database field per row) rendering for DetailsView Control in Details, Edit, Insert Pages in a Dynamic Data WebSite


DetailsView control on Edit, Insert, Details pages render the data as a HTML table with only 2 columns (1 column for the column name and the other for its database value). I would like to modify this default behaviour of the DetailsView control to render atleast 2 database fields per row to capture some of the real estate on the right side of the page.

Any suggestions are higly appreciated.




3/9/2009 1:31:45 AM 1365 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 40
Get it on Google Play
Get it on Apple App Store

You could use custome pages or have a look at this articles of mine here:

  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

Steve Big Smile

Seeking the 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
3/9/2009 11:25:16 AM

The DetailsView control that these templates are based on is designed around the two column style. You can customize the page templates to use a FormView which allows you to use asp:DynamicControl to place columns anywhere on the page you desire. For the next release of Dynamic Data (available in preview here: contains a new feature called Entity Templates. These will allow you to create a default layout template for all tables or provide custom layouts on a table by table basis.

Scott Hunter
PM, ASP.NET Team, Microsoft
3/9/2009 4:45:41 PM

Thanks Steve, I will look into your articles.

Thank you Scott. For now, I have used asp:DynamicControl to place columns in a DetailsView to accomplish what I wanted but it is very specific to a single table. Instead I wanted to create something generic for all tables. When is the next release planned?


3/9/2009 5:11:02 PM

Similar Artilces:

Dynamic Data WebSites Vs Dynamic Data Entities WebSite
Can anyone list some of basic differences between Dynamic Data WebSite and Dynamic Data Entities WebSite? When would you choose one over the other? Dynamic Data WebSites  requires a Linq to SQL data model. Dynamic Data Entities requires an ADO.Net Entity Framework data model.Rick -ASP.Net UE  My DD Blog  DD FAQ...

dynamic data: how to change default field value on edit/insert
Hi, how can i change the value when in edit/insert item mode. for example, i have a list (name, updatedby), when i click on edit or insert, i want to change the updatedby value to who edited/inserted the record. Hi Ferds, have a look at these: On Marcin's blog Dynamic Data Futures 6/25 update posted and on my blog DynamicData Default Values in ForegnKey_Edit & other FieldTemplates Hope this helps Steve Seeking the elegant solution.[Oh! If olny I colud tpye!]c# Bits blogOh, and don't forget to mark as answer any posts that help you Thanks, i was able to do it by creating a...

Missing Dynamic Data Website and Dynamic Data Web Application templates
 I have installed VS 2008 SP1 and .Net 3.5 SP1 but I still don't see the Dynamic Data Website and Dynamic Data Web Application templates when I try to create a new website or web application. Hi, when you choose to add a new project make sure that the targeted framework is indeed 3.5 and that you select the C# or VB.NET root node or in the Web node. Normally they should be in there. When I installed it on one of my laptops I didn't see them either. I didn't check the 3.5 framework and apparently it stood on 3.0 causing me to go like  until I found it. ...

Preview Release of Dynamic Data and Dynamic Data Website Wizard Available
Today we are releasing public updates to Dynamic Data and some new tooling support called the "Dynamic Data Website Wizard". These new releases are available for anyone to download the code gallery site at: Through this new site we will be able to release more frequent updates of these features. We would like to continue to have feedback on these new features via this forum. Here is a direct link to the download: One of the very cool new features is th...

Multistep Insert/Edit for Dynamic Data Controls [Wizard or Tab Control functionality]
Hi, Do DDCs have support for multistep insert/edit of table/view data? By this I mean a kind of wizard or tab control functionality.   Thanks  AhmadUK Hi Ahmad- Currently the Dynamic Data Controls don't support a wizard or tab interface for table data manipulation.  Dynamic Data Controls currently support GridViews for delete and edit, and DetailsView for delete, edit and insert.  This is an interesting feature though and one we will consider for the future.  Thanks for your suggestion.Polita PaulusThis posting is provided "AS IS" with no war...

Why does it not let me type data in my database fields and gives me error "No row was updated, the data in row 1 was not committed?
Hi, I'm typing example records in my database fields for username, last name, firstname, city, state, etc directly into the database field but when I try to save it it says:  No row was updated. The data in row 1 was not committed.Error Source: .NetSqlClient Data Provider.Error Message: String or binary data would be truncated.The statement has been terminated.Correct the errors and retry or press ESC to cancel the change(s) Basically I'm just typing data into the fields but it won't allow me to save them.    The data types are all saved as...

Adding ColumnOrder in my Metadata from Dynamic Data Futures to my existing Dynamic Data website
Hi,I currently have a dynamic data website (I did not use the dynamic data wizard) and would like to order my columns in my metadata file that I created.  When I put [ColumnOrder(x)] above one of my fields ie. public object Product { get; set; }  I get these errors: The type or namespace name 'ColumnOrder' could not be found (are you missing a using directive or an assembly reference?)  and  The type or namespace name 'ColumnOrderAttribute' could not be found (are you missing a using directive or an assembly reference?)  The  ...

how to insert data in to the data base from a dynamically generated user control
Hi, I am loading one user control dynamically multiple times in a single page inside of an dynamically generated html table row. I am able to load that user contol dynamically multiple times, but the problem is , i want to enter data in the dynamically loaded user control's text boxes and insert the same data in to the database tables. please provide me a simple example to insert data in to the data base from dynamically generated user control. ?   The code for dynamically loading an user control which i have written is as follows:   using System; using System.Data; using...

Can I use ADO.NET Data Services with Dynamic Data Websites?
I would like to use Dynamic Data Websites with the proxy class generated from WebDataGen.exe.  Is this possible?  Also, does the SchemaCreator class support the Provider model? In the current CTP, Dynamic Data only supports Linq To Sql models.  In th next release, it will also support Entity Framework models.  However, it won't directly support ADO.NET data services, though we are looking at this scenario for a later release. thanks,David...

How I modify the Defualt Url in DYnamic Data? Can I use Dynamic Data in a SUB FOLDER? Help
I am using Dynamic Data to manage the ADMIN section of my EXISISTING website.   So the site structure is: Root..... Pages.aspx, Default.aspx, more pages\Admin Folder.... Deafult.aspx, more pagea. Here is the Problem, when I visit the Defualt.aspx in Admin folder (WHICH I HAVE REPLACED with Dynamic Data pages) it loads the Deafult.aspx in the ROOT folder.I want to be able to set the Page that loads when the Dynamic Data sample is used. That is, I want to be able change the STARTING PAGE of a DYNAMIC DATA website. For example, say I have a Page in my Admin Folder named, Welcome.aspx...

Help with dynamic controls and retrieving data from dynamic controls
I am new to web development. My requirement is Text boxes get generated dynamically based on user input on click of a button called Ok after user enters values to these textboxes when user clicks on submit button ,values user entered to these textboxes have to be retrieved for further calculation I am generating text boxes in the ok button click event how to retrieve value user enters to these n where the procedure for that to be placed here u need to give name to id of every texbox in a specugic patterns so than u can know next time.   static int i = 0;protected...

How to override default insert method of Details View in Dynamic Data
I would like to change the default method of inserting data to make it use a stored procedure, plus I would like to get a return value from this stored procedure returned to the calling code. Scenario is that on insert the default behaviour is to go to the list view, but I would like to get from the insert the autogenerated primary key and use this to re-direct to a different form showing the newly inserted record. I see that I can create a partial class for the DataContext class and then create my own InsertTable method which will be called on the insert action, but this is a sub so it is...

Dynamic Data Website: Customize the hyperlink on the default.aspx page
I am using Dynamic Data in .net 3.5 sp1  For each table listed on the default page,  I want the hyperlink to load the insert page instead of the list page. The code out of box is: <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%#Eval("ListActionPath") %>'><%#Eval("DisplayName") %></asp:HyperLink> Looking at similar code in the list.aspx page I've tried using the GetActionPath() method, put I know the syntax is incorrect because I get an error during the build Here&...

How to add a blank row into GridView Control, for editing and inserting data into database.
Dear all:      I show my data in browser with ObjectDataSource and GridView .The GridView have Edit,Select,Update functions.However ,I have an idea that: if I click some button, the GridView Control can add one blank row in its bottom where I can Edit data and Insert these data into database.I don't know whether the GridView Control  have these function.      Please give me some advise.      Thanks a lot! The GridView don't support Insert. Take a look at th...

Web resources about - Modify default (1 database field per row) rendering for DetailsView Control in Details, Edit, Insert Pages in a Dynamic Data WebSite -

Visual Studio 2008 and .NET Framework 3.5 Service Pack 1 Beta
In this article, Scott discusses the recently released beta version of Visual Studio 2008 and .NET Framework 3.5 Service Pack 1. He starts with ...

Latest Updates
Latest Updates - Free source code and tutorials for Software developers and Architects.; Updated: 15 Feb 2013 - Upcoming stories is a community based news site edited by our members. It specialises in .NET development techniques, technologies and tools including ...

<asp:DetailsView ID="grd_empDetails" runat="server" DataSourceID="empDataSource -
Pastebin launched a little side project called , check it out ;-) Don't like ads?

Top Ranked Articles
Top Ranked Articles - Free source code and tutorials for Software developers and Architects.; Updated: 23 Feb 2013

Latest Updates
Latest Updates - Free source code and tutorials for Software developers and Architects.; Updated: 15 Feb 2013

Resources last updated: 12/16/2015 12:46:46 AM