<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET Dynamic Data</title><link>http://forums.asp.net/1145.aspx</link><description>Discussions regarding the new scaffolding framework in ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: multiple column unique identifiers</title><link>http://forums.asp.net/thread/2587406.aspx</link><pubDate>Thu, 28 Aug 2008 21:15:39 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2587406</guid><dc:creator>marcind</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2587406.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2587406</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;rbarnes:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;Does dynamic data offer a way OOTB to handle multiple column primary keys?&lt;/p&gt;
&lt;p&gt;Is the FK dropdown setting the text to the first text column in the related table then the value to the related id?&lt;/p&gt;
&lt;p&gt;When trying to set the data type edit/insert templates is there a way to set varchar &amp;#39;s that are over a certain length to be multirow?&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;1. Yes, DD supports composite PKs&lt;/p&gt;
&lt;p&gt;2. Yes, we have a heuristic that chooses which column to use for display purposes in the foreign key dropdowns. You can override it by applying the DisplayColumnAttribute to your entity type. If you want to construct a display string from multiple columns you can declare a new read-only property in your partial class that returns the result that you want and use the name of that property as the input to DisplayColumnAttribute (note, this will only work in Linq To SQL, in EF you could try to just override the ToString method of the entity).&lt;/p&gt;
&lt;p&gt;3. Dynamic Data will automatically detect DB types such as varchar(max) or text and display them as multi-row. If you want to for certain varchar(n) columns to display as multi-row you could apply DataTypeAttribute(DataType.MultilineText)&amp;nbsp;to them.&lt;/p&gt;</description></item><item><title>multiple column unique identifiers</title><link>http://forums.asp.net/thread/2582587.aspx</link><pubDate>Wed, 27 Aug 2008 07:13:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2582587</guid><dc:creator>rbarnes</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2582587.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2582587</wfw:commentRss><description>&lt;p&gt;I have been working thru the &lt;em&gt;Scott Hanselman&lt;/em&gt; videos and have been very impressed with dynamic data so far but I have run into something that is posing a problem for me.&amp;nbsp; I have two related table.&lt;/p&gt;
&lt;p&gt;Listed below.&amp;nbsp; Dynamic data is not displaying&amp;nbsp;the up stream and down stream fields at all and the &lt;/p&gt;
&lt;p&gt;stream segment table&amp;nbsp;with all three fields set to primary key because you can have a single stream segment id in there several times but with different up and down stream stateCodes.&amp;nbsp; But at the same time you can have the same up and down stream code for a stream segment.&amp;nbsp; Therefore all three columns are combined for a unique row.&lt;/p&gt;
&lt;p&gt;Stream_Segment&amp;nbsp;varchar(50)&amp;nbsp;not null&lt;br /&gt;Upstream_Shefcode&amp;nbsp;varchar(10)&amp;nbsp;not null&lt;br /&gt;Downstream_Shefcode&amp;nbsp;varchar(10)&amp;nbsp;not null&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;stateCode table where code_identifier is primary key&lt;/p&gt;
&lt;p&gt;code_Identifier&amp;nbsp;varchar(10)&amp;nbsp;not null&lt;br /&gt;code_Name&amp;nbsp;varchar(50)&amp;nbsp;not null&lt;br /&gt;code_Description&amp;nbsp;varchar(100)&amp;nbsp;nullable&lt;br /&gt;code_Latitude&amp;nbsp;float&amp;nbsp;not null&lt;br /&gt;code_Longtitude&amp;nbsp;float&amp;nbsp;not null&lt;/p&gt;
&lt;p&gt;The stream segment table is then related to&amp;nbsp;another table&amp;nbsp;called diversions that has all three columns from the stream segment table but on the insert or edit pages for the diversions table it is only showing the first column stream_segment not up or down state codes.&amp;nbsp; Since they aren&amp;#39;t&amp;nbsp;unique the&amp;nbsp;same stream segment numbers are appearing multiple times.&amp;nbsp; If i select one and do an insert it inserts the correct unique segment, up and down.&amp;nbsp; I can tell by the order in the&amp;nbsp;source table.&amp;nbsp;Interestingly enough in the screenshot it is appending a 1 to the end of the field name. screen shot attached.&lt;/p&gt;
&lt;p&gt;&lt;img title="screenshot" style="WIDTH:417px;HEIGHT:787px;" height="787" alt="screenshot" src="http://www.buzworks.com/images/diversioninsert.jpg" width="417" /&gt;&lt;/p&gt;
&lt;p&gt;I know that the insert and edit pages for the stream segment table will be interesting because when they change the stream segment dropdown then i will have to change the valid up and down stream state codes to populate the other ddls. I know... tmi.&lt;/p&gt;
&lt;p&gt;Bottom line &lt;/p&gt;
&lt;p&gt;Does dynamic data offer a way OOTB to handle multiple column primary keys?&lt;/p&gt;
&lt;p&gt;Is the FK dropdown setting the text to the first text column in the related table then the value to the related id?&lt;/p&gt;
&lt;p&gt;When trying to set the data type edit/insert templates is there a way to set varchar &amp;#39;s that are over a certain length to be multirow?&lt;/p&gt;
&lt;p&gt;Sorry for all the questions but i am excited about how much work this could save me in the very near future and i can&amp;#39;t find any other resources on the topic yet.&lt;/p&gt;
&lt;p&gt;I tried the latest wizard to no avail.&lt;/p&gt;
&lt;p&gt;Thanks if you have even read this far.&amp;nbsp; :)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>