<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.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>Craig Shoemaker - All Comments</title><link>http://weblogs.asp.net/craigshoemaker/default.aspx</link><description>&lt;a href="http://polymorphicpodcast.com/"&gt;Host of the Polymorphic Podcast&lt;/a&gt; and &lt;a href="http://infragistics.com/"&gt;New Media Evangelist for Infragistics&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Introduction to Dynamic Data | asp.net Digest</title><link>http://weblogs.asp.net/craigshoemaker/archive/2008/05/14/introduction-to-dynamic-data.aspx#6192739</link><pubDate>Thu, 15 May 2008 15:08:03 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6192739</guid><dc:creator>Introduction to Dynamic Data | asp.net Digest</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Introduction to Dynamic Data | asp.net Digest&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6192739" width="1" height="1"&gt;</description></item><item><title>Introduction to Dynamic Data</title><link>http://weblogs.asp.net/craigshoemaker/archive/2008/05/09/generic-access-to-asp-net-dynamic-data-uihint-attribute-values.aspx#6189854</link><pubDate>Wed, 14 May 2008 22:07:33 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6189854</guid><dc:creator>Craig Shoemaker</dc:creator><description>&lt;p&gt;Get started with ASP.NET Dynamic Data with some practical advice. Listen to the podcast Watch the screen&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6189854" width="1" height="1"&gt;</description></item><item><title>Introduction to Dynamic Data</title><link>http://weblogs.asp.net/craigshoemaker/archive/2008/05/08/passing-arguments-to-a-dynamic-data-field-template-from-a-uihint-attribute.aspx#6189773</link><pubDate>Wed, 14 May 2008 21:41:57 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6189773</guid><dc:creator>Craig Shoemaker</dc:creator><description>&lt;p&gt;Get started with ASP.NET Dynamic Data with some practical advice. Listen to the podcast Watch the screen&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6189773" width="1" height="1"&gt;</description></item><item><title>re: The Sweet Sound of a Million Microsoft Haters Heads Exploding</title><link>http://weblogs.asp.net/craigshoemaker/archive/2008/02/21/the-sweet-sound-of-a-million-microsoft-haters-heads-exploding.aspx#6182453</link><pubDate>Mon, 12 May 2008 13:42:47 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6182453</guid><dc:creator>TooManyBeansForLunch</dc:creator><description>&lt;p&gt;Got a news flash for all the MS-hating fan boys out there:&lt;/p&gt;
&lt;p&gt;Fining foreign companies is all the EU does. &lt;/p&gt;
&lt;p&gt;Want a list of all the US corporate victims of EUSSR &amp;quot;regulations&amp;quot;? RTFM. &lt;/p&gt;
&lt;p&gt;It&amp;#39;s called &amp;quot;protectionism&amp;quot; and &amp;quot;trade tariffs.&amp;quot; They&amp;#39;re pathetically impotent and unpopular amongst their own and probably have another 10-15 years left - max. &lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6182453" width="1" height="1"&gt;</description></item><item><title>silverlight game programming</title><link>http://weblogs.asp.net/craigshoemaker/archive/2008/04/29/creating-immersive-silverlight-video-experiences.aspx#6178126</link><pubDate>Sun, 11 May 2008 07:26:25 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6178126</guid><dc:creator>silverlight game programming</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;silverlight game programming&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6178126" width="1" height="1"&gt;</description></item><item><title>re: Generic Access to ASP.NET Dynamic Data UIHint Attribute Values</title><link>http://weblogs.asp.net/craigshoemaker/archive/2008/05/09/generic-access-to-asp-net-dynamic-data-uihint-attribute-values.aspx#6174493</link><pubDate>Fri, 09 May 2008 20:00:10 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6174493</guid><dc:creator>craigshoemaker</dc:creator><description>&lt;p&gt;Peter: Thanks for sharing your code! I will add it to my solution and play around with it.&lt;/p&gt;
&lt;p&gt;Scott: Thanks for the tip. I knew that switch was really nasty :) I updated the post with your suggestion.&lt;/p&gt;
&lt;p&gt; - Craig&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6174493" width="1" height="1"&gt;</description></item><item><title>re: Generic Access to ASP.NET Dynamic Data UIHint Attribute Values</title><link>http://weblogs.asp.net/craigshoemaker/archive/2008/05/09/generic-access-to-asp-net-dynamic-data-uihint-attribute-values.aspx#6174352</link><pubDate>Fri, 09 May 2008 19:05:07 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6174352</guid><dc:creator>Scott Hanselman</dc:creator><description>&lt;p&gt;Rather than that switch statement, can&amp;#39;t you do something like:&lt;/p&gt;
&lt;p&gt;var foo = TypeDescriptor.GetConverter(T)&lt;/p&gt;
&lt;p&gt;foo.ConvertFromInvariantString(bar);&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6174352" width="1" height="1"&gt;</description></item><item><title>re: Generic Access to ASP.NET Dynamic Data UIHint Attribute Values</title><link>http://weblogs.asp.net/craigshoemaker/archive/2008/05/09/generic-access-to-asp-net-dynamic-data-uihint-attribute-values.aspx#6174184</link><pubDate>Fri, 09 May 2008 18:07:42 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6174184</guid><dc:creator>plblum</dc:creator><description>&lt;p&gt;Hi Craig,&lt;/p&gt;
&lt;p&gt;I am building support for Dynamic Data in the next upgrade to Peter&amp;#39;s Data Entry Suite. I&amp;#39;ve created a new FieldTemplateUserControl base class to use (subclassed from the original with a bunch of enhancements.) One of these enhancements is your request, to add it in the base class.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s my current code. (While its from a commercial application, I agree to allow it used freely by all.) The ApplyUIHintControlParms() method is called from OnPreRender or OnInit, depending on if the user wants the UIHintAttribute to override their own settings (including those from the properties assigned to the DynamicControl that have the same capabilities.)&lt;/p&gt;
&lt;p&gt;/// &amp;lt;summary&amp;gt;&lt;/p&gt;
&lt;p&gt;/// UIHintAttribute lets the user deliver name/value pairs to be assigned to&lt;/p&gt;
&lt;p&gt;/// properties on the FieldTemplate. This applies them.&lt;/p&gt;
&lt;p&gt;/// &amp;lt;/summary&amp;gt;&lt;/p&gt;
&lt;p&gt;/// &amp;lt;remarks&amp;gt;&lt;/p&gt;
&lt;p&gt;/// &amp;lt;para&amp;gt;Requires a UIHintAttribute assigned. (The UIHint can omit the actual hint name so &lt;/p&gt;
&lt;p&gt;/// it uses the default template.)&amp;lt;/para&amp;gt;&lt;/p&gt;
&lt;p&gt;/// &amp;lt;para&amp;gt;Gets the name/value pairs from UIHintAttribute.ControlParameter.&lt;/p&gt;
&lt;p&gt;/// Each ControlParameter.name is used as a property name on the FTUC.&lt;/p&gt;
&lt;p&gt;/// If the name doesn&amp;#39;t match (case insensitive), it is ignored instead of throwing an exception.&lt;/p&gt;
&lt;p&gt;/// The trace will report it though.&amp;lt;/para&amp;gt;&lt;/p&gt;
&lt;p&gt;/// &amp;lt;/remarks&amp;gt;&lt;/p&gt;
&lt;p&gt;public virtual void ApplyUIHintControlParms()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; UIHintAttribute vUIHintAtt = Column.Attributes.OfType&amp;lt;UIHintAttribute&amp;gt;().FirstOrDefault();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; if ((vUIHintAtt != null) &amp;amp;&amp;amp; (vUIHintAtt.ControlParameters != null))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach (string vName in vUIHintAtt.ControlParameters.Keys)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; object vValue = vUIHintAtt.ControlParameters[vName]; &amp;nbsp;// may be null&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PropertyInfo vPropertyInfo = this.GetType().GetProperty(vName, BindingFlags.Public | BindingFlags.Instance);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (vPropertyInfo != null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // if PropertyType is System.Type, no type converter is offered. Instead, translate it manually&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (vPropertyInfo.PropertyType == typeof(Type))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (vValue is string)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Type vType = Type.GetType((string) vValue, false, true);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vPropertyInfo.SetValue(this, vType, null);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// ignored if not a string type&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TypeConverter vTypeConverter = TypeDescriptor.GetConverter(vPropertyInfo.PropertyType);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (vTypeConverter == null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Page.Trace.IsEnabled)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Page.Trace.Write(&amp;quot;UIHint on column &amp;quot; + ColumnName + &amp;quot; of table &amp;quot; + Table.Name + &amp;quot; is specifies the property name &amp;quot; + vName + &amp;quot; on FieldTemplate type &amp;quot; + this.GetType().FullName + &amp;quot;. The property VALUE is not legal for the property whose type is &amp;quot; + vPropertyInfo.PropertyType.FullName + &amp;quot;.&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// convert and set it&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;object vConvertedValue = vTypeConverter.ConvertFrom(vValue);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vPropertyInfo.SetValue(this, vConvertedValue, null); &amp;nbsp; // may throw a TargetException in design mode when in VS2005/8&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else if (Page.Trace.IsEnabled)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Page.Trace.Write(&amp;quot;UIHint on column &amp;quot; + ColumnName + &amp;quot; of table &amp;quot; + Table.Name + &amp;quot; is specifies the property name &amp;quot; + vName + &amp;quot; on FieldTemplate type &amp;quot; + this.GetType().FullName + &amp;quot;. This property does not exist and has been ignored. The property name is case sensitive.&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception pE)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (Page.Trace.IsEnabled)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Page.Trace.Warn(&amp;quot;UIHint on column &amp;quot; + ColumnName + &amp;quot; of table &amp;quot; + Table.Name + &amp;quot; is incorrectly setup and caused an exception (which has been ignored.). The ControlParameter with the problem is named &amp;quot; + vName + &amp;quot; and its value is &amp;quot; + (vValue != null ? vValue.ToString() : &amp;quot;null&amp;quot;) + &amp;quot;.&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;} &amp;nbsp;// ApplyUIHintControlParameters&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6174184" width="1" height="1"&gt;</description></item><item><title>Generic Access to ASP.NET Dynamic Data UIHint Attribute Values</title><link>http://weblogs.asp.net/craigshoemaker/archive/2008/05/08/passing-arguments-to-a-dynamic-data-field-template-from-a-uihint-attribute.aspx#6174009</link><pubDate>Fri, 09 May 2008 17:01:43 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6174009</guid><dc:creator>Craig Shoemaker</dc:creator><description>&lt;p&gt;Yesterday I published a post titled, Passing Arguments to a Dynamic Data Field Template from a UIHint&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6174009" width="1" height="1"&gt;</description></item><item><title>DotNetRocks Part Deux</title><link>http://weblogs.asp.net/craigshoemaker/archive/2008/05/01/what-s-it-gonna-take-to-get-asp-net-mvc-to-rtm.aspx#6163026</link><pubDate>Tue, 06 May 2008 20:09:58 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6163026</guid><dc:creator>you've been HAACKED</dc:creator><description>&lt;p&gt;DotNetRocks Part Deux&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6163026" width="1" height="1"&gt;</description></item></channel></rss>