Last post Jun 03, 2010 05:49 AM by sjnaughton
Jun 02, 2010 11:20 AM|austinco|LINK
So I am trying to make my custom pages where they have a completely different layout than the normal details view and when I replace the <asp:DynamicEntity> with the HTML tags and the <asp:DynamicControls> it does work but the foreign key fields do not show
up as dropdowns, when I put a UIHint="ForeignKey" on thier respective columns, it only has the default [Not Set]; so it isn't linking to its respective table to populate the dropdown, Im told that I need to code this but I am not sure where and how I need
to do so.
Jun 02, 2010 11:54 AM|sjnaughton|LINK
You must use the DynamicControl as this facilitates DD the DynamicEntity facilitates Entity Templates you should have a look at custom EntityTemplate for custom layout.
Jun 02, 2010 11:59 AM|austinco|LINK
And actually I have tried that route aswell with the same results
Edit: and I am using Linq to SQL if thatn makes a difference
This is from the entity template .aspx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Cities_Insert.ascx.cs" Inherits="DynamicData_EntityTemplates_Cities_Insert" %>
<%--<asp:EntityTemplate runat="server" ID="EntityTemplate1">
<td class="DDLightHeader"><asp:Label ID="Label1" runat="server" Text="City" /></td>
<td><asp:DynamicControl ID="DynamicControl1" runat="server" DataField="City" Mode="Insert" /></td>
<td class="DDLightHeader"><asp:Label ID="Label2" runat="server" Text="Region" /></td>
<asp:DynamicControl ID="DynamicControl2" runat="server" DataField="Region_ID" Mode="Insert" />
<%--<asp:DropDownList ID="Region_ID" runat="server" DataSourceID="ldsRegions" DataTextField="Region_Name" DataValueField="Region_ID" AutoPostBack="false" />--%>
<asp:LinqDataSource runat="server" ID="ldsRegions" ContextTypeName="ConstructionProjectsDataContext" EntityTypeName="" TableName="tblRegions" Select="new (Region_Name, Region_ID)" />
Jun 02, 2010 12:48 PM|sjnaughton|LINK
Hi Austinco, Linq to SQL does simplyfly things, it may be better if can tell me what you want to achive and the I can recommend the best method or even point to a solution.
Jun 02, 2010 01:04 PM|austinco|LINK
In this instance, I simply need to rearrange the layout for the page for my Cities insert page, not in the default vertical list that DD defaults to. Im having trouble finding any guides or tutorials for this. It does seem like an entity template is the
right direction to do for this.
Actually, I got 'er
Jun 03, 2010 05:49 AM|sjnaughton|LINK
Yes and Entity Template is ripe for that, the default one give an over complicated sample of entity templates. Remember that the Details, Edit and Insert pages are now FormView based, so all you need for an Entity Template is the equivalent FormView Template
named appropriatly, so you could leave the code behind empty and just add the formatting there is a simple example in the "DynamicData Preview4 Refresh" sample previously on codeplex which I have put on my sky drive here
DynamicDataPreview4Refresh if you would like to have a look.
VS2010 & .Net 4.0