<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Automated string length validation</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Automated string length validation</description>
  <pubDate>Wed, 13 May 2026 01:56:15 -700</pubDate>
  <lastBuildDate>Wed, 15 Aug 2012 18:17:59 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=3577</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Automated string length validation :    If you want immediate feedback...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14196#14196</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3577<br /><strong>Posted:</strong> 15-Aug-2012 at 6:17pm<br /><br />If you want immediate feedback as the user types, all you have to do is set UpdateSourceTrigger to PropertyChanged. That will cause the verifier to evaluate continously as the user types. Anyway, just another option to consider. Thanks for sharing your code.<div>&nbsp;</div><pre style="color: black; font-family: C&#111;nsolas;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: blue;">&lt;</span><span>TextBox</span><span style="color: red;">&nbsp;</span><span style="color: red;">Text</span><span style="color: blue;">="{</span><span>Binding</span><span style="color: red;">&nbsp;CustomerEntity</span><span style="color: blue;">.</span><span style="color: blue;">CompanyName</span><span style="color: blue;">,</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">&nbsp;ValidatesOnDataErrors</span><span style="color: blue;">=</span><span style="color: blue;">True</span><span style="color: blue;">,</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">&nbsp;UpdateSourceTrigger</span><span style="color: blue;">=</span><span style="color: blue;">PropertyChanged</span><span style="color: blue;">}</span><span style="color: blue;">"</span><span style="color: blue;">&nbsp;/&gt;</span></pre><span style="font-size:10px"><br /><br />Edited by mgood - 15-Aug-2012 at 6:22pm</span>]]>
   </description>
   <pubDate>Wed, 15 Aug 2012 18:17:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14196#14196</guid>
  </item> 
  <item>
   <title>Automated string length validation : I&amp;#039;ll check out Cocktail,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14195#14195</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1500" rel="nofollow">harald</a><br /><strong>Subject:</strong> 3577<br /><strong>Posted:</strong> 15-Aug-2012 at 5:32pm<br /><br />I'll check out Cocktail, thanks.<br><br>I checked out the TempHire link and that is indeed the behavior I don't want.<br>I think it is much easier from the user's perspective to get the immediate feedback when (s)he types and further typing is prevented when the max is reached.<br><br>Since you guys have been so helpful, I am sharing the solution I am using now. It works well. I implemented a value converter that I bind to like this in xaml:<br><br><pre style="font-family:C&#111;nsolas;font-size:16;color:black;:#ffffce;"><span style="color:#ff2828;">&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;"></span><span style="color:#a31515;">TextBox</span><span style="color:red;">&nbsp;Width</span><span style="color:blue;">=</span><span style="color:blue;">"500"</span><span style="color:red;">&nbsp;Style</span><span style="color:blue;">="{</span><span style="color:#a31515;">StaticResource</span><span style="color:red;">&nbsp;TextBoxStyle</span><span style="color:blue;">}</span><span style="color:blue;">"</span>&nbsp;&nbsp;&nbsp;<span style="color:red;"> MaxLength</span><span style="color:blue;">="{</span><span style="color:#a31515;">Binding</span><span style="color:red;">&nbsp;Converter</span><span style="color:blue;">={</span><span style="color:#a31515;">StaticResource</span><span style="color:red;">&nbsp;LengthConverter</span><span style="color:blue;">},</span><span style="color:red;">&nbsp;ConverterParameter</span><span style="color:blue;">=</span><span style="color:blue;">'Provider.pro_contact'</span><span style="color:blue;">}</span><span style="color:blue;">"</span>&nbsp;&nbsp;&nbsp;<span style="color:red;"> Text</span><span style="color:blue;">="{</span><span style="color:#a31515;">Binding</span><span style="color:red;">&nbsp;Provider</span><span style="color:blue;">.</span><span style="color:blue;">pro_contact</span><span style="color:blue;">,</span><span style="color:red;">&nbsp;Mode</span><span style="color:blue;">=</span><span style="color:blue;">TwoWay</span><span style="color:blue;">}</span><span style="color:blue;">"</span>&nbsp;<span style="color:blue;">&nbsp;/&gt;</span></pre><br>Note, that the text I pass on to the ConverterParameter specifies the type Provider and not the property named Provider.<br>The way it is implemented it only works for entities in a certain name space, which is fine in our scenario.<br>If you want to make it universal, you'd need to iterate through the assemblies to look for the type in the method GetMaxStringLength. Alternatively, you could provide the name space in the parameters as well.<br><br><pre style="font-family:C&#111;nsolas;font-size:16;color:black;:#ffffce;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">public</span>&nbsp;<span style="font-weight:bold;color:blue;">class</span>&nbsp;<span style="color:#2b91af;">LengthConverter</span>&nbsp;:&nbsp;<span style="color:#2b91af;">IValueConverter</span>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;summary&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;Converts&nbsp;the&nbsp;name&nbsp;of&nbsp;a&nbsp;property&nbsp;to&nbsp;the&nbsp;maximum&nbsp;string&nbsp;length&nbsp;of&nbsp;its&nbsp;property.</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;NOTE:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;This&nbsp;converter&nbsp;only&nbsp;works&nbsp;with&nbsp;entities&nbsp;in&nbsp;AUDDomainModel.</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;/summary&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;param&nbsp;name=</span><span style="color:gray;">"value"</span><span style="color:gray;">&gt;</span><span style="color:green;">not&nbsp;used</span><span style="color:gray;">&lt;/param&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;param&nbsp;name=</span><span style="color:gray;">"targetType"</span><span style="color:gray;">&gt;</span><span style="color:green;">not&nbsp;used</span><span style="color:gray;">&lt;/param&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;param&nbsp;name=</span><span style="color:gray;">"parameter"</span><span style="color:gray;">&gt;</span><span style="color:green;">The&nbsp;name&nbsp;of&nbsp;the&nbsp;entity&nbsp;property,&nbsp;e.g.&nbsp;"Client.clt_title"</span><span style="color:gray;">&lt;/param&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;param&nbsp;name=</span><span style="color:gray;">"culture"</span><span style="color:gray;">&gt;</span><span style="color:green;">not&nbsp;used</span><span style="color:gray;">&lt;/param&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;returns&gt;</span><span style="color:green;">the&nbsp;string&nbsp;length,&nbsp;or&nbsp;0&nbsp;if&nbsp;it&nbsp;could&nbsp;not&nbsp;be&nbsp;determined.</span><span style="color:gray;">&lt;/returns&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">public</span>&nbsp;<span style="font-weight:bold;color:blue;">object</span>&nbsp;Convert(<span style="font-weight:bold;color:blue;">object</span>&nbsp;value,&nbsp;<span style="color:#2b91af;">Type</span>&nbsp;targetType,&nbsp;<span style="font-weight:bold;color:blue;">object</span>&nbsp;parameter,&nbsp;<span style="color:#2b91af;">CultureInfo</span>&nbsp;culture)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">int</span>&nbsp;length&nbsp;=&nbsp;<span style="color:#ff2828;">0</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">string</span>&nbsp;name&nbsp;=&nbsp;parameter&nbsp;<span style="font-weight:bold;color:blue;">as</span>&nbsp;<span style="font-weight:bold;color:blue;">string</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">string</span>&#091;&#093;&nbsp;n&nbsp;=&nbsp;name.Split(<span style="color:#ff2828;">'.'</span>);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">if</span>&nbsp;(n.Length&nbsp;==&nbsp;<span style="color:#ff2828;">2</span>)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;length&nbsp;=&nbsp;GetMaxStringLength(n&#091;<span style="color:#ff2828;">0</span>&#093;,&nbsp;n&#091;<span style="color:#ff2828;">1</span>&#093;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">return</span>&nbsp;length;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;summary&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;Get&nbsp;the&nbsp;max&nbsp;string&nbsp;length&nbsp;attribute&nbsp;of&nbsp;a&nbsp;property&nbsp;(using&nbsp;reflection).</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;/summary&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;param&nbsp;name=</span><span style="color:gray;">"entityType"</span><span style="color:gray;">&gt;</span><span style="color:green;">Type&nbsp;of&nbsp;entity</span><span style="color:gray;">&lt;/param&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;param&nbsp;name=</span><span style="color:gray;">"propertyName"</span><span style="color:gray;">&gt;</span><span style="color:green;">The&nbsp;name&nbsp;of&nbsp;the&nbsp;entity&nbsp;property</span><span style="color:gray;">&lt;/param&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;returns&gt;</span><span style="color:green;">The&nbsp;max&nbsp;string&nbsp;length,&nbsp;or&nbsp;0&nbsp;if&nbsp;not&nbsp;applicable.</span><span style="color:gray;">&lt;/returns&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">private</span>&nbsp;<span style="font-weight:bold;color:blue;">int</span>&nbsp;GetMaxStringLengthAttribute(<span style="color:#2b91af;">Type</span>&nbsp;entityType,&nbsp;<span style="color:#2b91af;">String</span>&nbsp;propertyName)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">int</span>&nbsp;length&nbsp;=&nbsp;<span style="color:#ff2828;">0</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">try</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">var</span>&nbsp;propertyInfo&nbsp;=&nbsp;entityType.GetProperty(propertyName);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">var</span>&nbsp;attributes&nbsp;=&nbsp;(<span style="color:#2b91af;">StringLengthVerifierAttribute</span>)propertyInfo.GetCustomAttributes(<span style="font-weight:bold;color:blue;">typeof</span>(<span style="color:#2b91af;">StringLengthVerifierAttribute</span>),&nbsp;<span style="font-weight:bold;color:blue;">false</span>).First();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;length&nbsp;=&nbsp;attributes.MaxValue;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">catch</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:green;">//&nbsp;An&nbsp;exception&nbsp;is&nbsp;thrown&nbsp;if&nbsp;the&nbsp;type&nbsp;does&nbsp;not&nbsp;have&nbsp;a&nbsp;maximum&nbsp;length&nbsp;attribute,</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:green;">//&nbsp;which&nbsp;is&nbsp;true&nbsp;for&nbsp;unlimited&nbsp;strings&nbsp;and&nbsp;all&nbsp;non-string&nbsp;types.</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">return</span>&nbsp;length;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <span style="color:green;"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;summary&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;Get&nbsp;the&nbsp;max&nbsp;string&nbsp;length&nbsp;attribute&nbsp;of&nbsp;a&nbsp;property&nbsp;(using&nbsp;reflection).</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;Note:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;This&nbsp;currently&nbsp;only&nbsp;works&nbsp;for&nbsp;entities&nbsp;in&nbsp;AUDDomainModel.</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;/summary&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;param&nbsp;name=</span><span style="color:gray;">"entityName"</span><span style="color:gray;">&gt;</span><span style="color:green;">The&nbsp;name&nbsp;of&nbsp;the&nbsp;entity&nbsp;(as&nbsp;string).</span><span style="color:gray;">&lt;/param&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;param&nbsp;name=</span><span style="color:gray;">"propertyName"</span><span style="color:gray;">&gt;</span><span style="color:green;">The&nbsp;name&nbsp;of&nbsp;the&nbsp;entity&nbsp;property.</span><span style="color:gray;">&lt;/param&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:gray;">///</span><span style="color:green;">&nbsp;</span><span style="color:gray;">&lt;returns&gt;</span><span style="color:green;">The&nbsp;max&nbsp;string&nbsp;length,&nbsp;or&nbsp;0&nbsp;if&nbsp;not&nbsp;applicable.</span><span style="color:gray;">&lt;/returns&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">private</span>&nbsp;<span style="font-weight:bold;color:blue;">int</span>&nbsp;GetMaxStringLength(<span style="font-weight:bold;color:blue;">string</span>&nbsp;entityName,&nbsp;<span style="font-weight:bold;color:blue;">string</span>&nbsp;propertyName)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:green;">//&nbsp;Note:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:green;">//&nbsp;The&nbsp;",&nbsp;AUDDomainModel"&nbsp;bit&nbsp;is&nbsp;necessary.&nbsp;It&nbsp;won't&nbsp;work&nbsp;without&nbsp;it.</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">string</span>&nbsp;fullname&nbsp;=&nbsp;<span style="font-weight:bold;color:blue;">string</span>.Format(<span style="color:#ff2828;">"AUDDomainModel.{0},&nbsp;AUDDomainModel"</span>,&nbsp;entityName);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#2b91af;">Type</span>&nbsp;t&nbsp;=&nbsp;<span style="color:#2b91af;">Type</span>.GetType(fullname);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">return</span>&nbsp;GetMaxStringLengthAttribute(t,&nbsp;propertyName);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">public</span>&nbsp;<span style="font-weight:bold;color:blue;">object</span>&nbsp;ConvertBack(<span style="font-weight:bold;color:blue;">object</span>&nbsp;value,&nbsp;<span style="color:#2b91af;">Type</span>&nbsp;targetType,&nbsp;<span style="font-weight:bold;color:blue;">object</span>&nbsp;parameter,&nbsp;<span style="color:#2b91af;">CultureInfo</span>&nbsp;culture)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:bold;color:blue;">throw</span>&nbsp;<span style="font-weight:bold;color:blue;">new</span>&nbsp;<span style="color:#2b91af;">NotImplementedException</span>();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;}</pre><br>]]>
   </description>
   <pubDate>Wed, 15 Aug 2012 17:32:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14195#14195</guid>
  </item> 
  <item>
   <title>Automated string length validation :    StringLengthVerifier is...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14194#14194</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3577<br /><strong>Posted:</strong> 15-Aug-2012 at 5:03pm<br /><br />StringLengthVerifier is what we call a property verifier. It kicks in as soon as the property setter is called and again when you try to save. The setter gets called as soon as you tab out of the textbox the way I have the binding above. In order to get immediate feedback on the UI you need to specify ValidatesOnDataErrors=true as I have above. You'll get immediate feedback in the form of a red border around the text box. If you don't get the red border, then you most likely need to fix your styles.<div>&nbsp;</div><div>You can see what I'm talking about in our Cocktail Reference Application (TempHire) in action. Click on this link <a href="http://apps.ideablade.com/TempHire/" target="_blank">http://apps.ideablade.com/TempHire/</a>&nbsp;to launch the Silverlight version. Login, go to Resource Management and edit a resource. Enter less than 5 or more than 10 digits in the zip code box and tab out of it. Notice how you immediately get a red border. This doesn't currently work in the WPF version of TempHire, because I haven't had a chance to fix the styles, but it works in a dummy WPF app that doesn't have any styles messing up the red border. For example you can check out our WPF DevTour <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/tour-devforce-wpf" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/tour-devforce-wpf</a>.</div><div>&nbsp;</div><div>Preventing the user from typing past the MaxLength is a bit unusual, but intriguing and yes to do that you need to bind MaxLength to something in the ViewModel that can obtain the length from the PropertyMetadata.</div><div>&nbsp;</div><div>Since you are new to DevForce and if you are not already aware of it, you may be interested in Cocktail, our free open-source end-to-end XAML application framework <a href="http://cocktail.ideablade.com/" target="_blank">http://cocktail.ideablade.com/</a>. In addition we offer jump start training as part of our professional services offerings if you feel like that's something you want.</div><div>&nbsp;</div><div>Hope this gives you something to go on.</div><div>&nbsp;</div><div>&nbsp;</div><span style="font-size:10px"><br /><br />Edited by mgood - 15-Aug-2012 at 5:06pm</span>]]>
   </description>
   <pubDate>Wed, 15 Aug 2012 17:03:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14194#14194</guid>
  </item> 
  <item>
   <title>Automated string length validation :  Thanks, Marcel, for taking the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14193#14193</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1500" rel="nofollow">harald</a><br /><strong>Subject:</strong> 3577<br /><strong>Posted:</strong> 15-Aug-2012 at 3:59pm<br /><br />Thanks, Marcel, for taking the time.<br><br><br>That's basically what we had all along. It works in the sense that the verification kicks in when I try to save the entity.<br>We did get the verification errors at that point.<br>But that's way too late.<br><br>I just re-read my OP and I guess I wasn't very clear in what I want.<br><br>What I want is the behavior I get when I set the MaxLength property of a TextBox: the user is prevented from entering more characters than MaxLength specifies. I need the feedback WHILE the user types, not when I try to save then entity, cause then the user needs to go back and fix things. That's inconvenient.<br><br>Or am I missing something?<br><br><br><span style="font-size:10px"><br /><br />Edited by harald - 15-Aug-2012 at 4:03pm</span>]]>
   </description>
   <pubDate>Wed, 15 Aug 2012 15:59:41 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14193#14193</guid>
  </item> 
  <item>
   <title>Automated string length validation : You don&amp;#039;t have to decorate...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14190#14190</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3577<br /><strong>Posted:</strong> 15-Aug-2012 at 1:25am<br /><br />You don't have to decorate anything on the ViewModel. Let's take a look at a quick example. Let's take the Customer entity generated from the NorthwindIB database and let's look at the CompanyName property. Notice the DevForce code generator, generated a bunch of attributes including a StringLengthVerifier.<div><pre style="font-family: C&#111;nsolas; font-size: 13px; : white; "><br ="Apple-interchange-newline">&nbsp;&nbsp;<span style="color: blue; ">public</span>&nbsp;<span style="color: blue; ">partial</span>&nbsp;<span style="color: blue; ">class</span>&nbsp;<span style="color: rgb43, 145, 175; ">Customer</span>&nbsp;:&nbsp;IbEm.<span style="color: rgb43, 145, 175; ">Entity</span>&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: gray; ">///</span><span style="color: green; ">&nbsp;</span><span style="color: gray; ">&lt;summary&gt;</span><span style="color: green; ">Gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;CompanyName.&nbsp;</span><span style="color: gray; ">&lt;/summary&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&#091;<span style="color: rgb43, 145, 175; ">DataMember</span>&#093;&nbsp;&nbsp;&nbsp;&nbsp;&#091;<span style="color: rgb43, 145, 175; ">Bindable</span>(<span style="color: blue; ">true</span>,&nbsp;<span style="color: rgb43, 145, 175; ">BindingDirection</span>.TwoWay)&#093;&nbsp;&nbsp;&nbsp;&nbsp;&#091;<span style="color: rgb43, 145, 175; ">Editable</span>(<span style="color: blue; ">true</span>)&#093;&nbsp;&nbsp;&nbsp;&nbsp;&#091;<span style="color: rgb43, 145, 175; ">Display</span>(Name=<span style="color: rgb163, 21, 21; ">"CompanyName"</span>,&nbsp;AutoGenerateField=<span style="color: blue; ">true</span>)&#093;&nbsp;&nbsp;&nbsp;&nbsp;&#091;IbVal.<span style="color: rgb43, 145, 175; ">StringLengthVerifier</span>(MaxValue=40,&nbsp;IsRequired=<span style="color: blue; ">true</span>,&nbsp;ErrorMessageResourceName=<span style="color: rgb163, 21, 21; ">"Customer_CompanyName"</span>)&#093;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">public</span>&nbsp;<span style="color: blue; ">string</span>&nbsp;CompanyName&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">get</span>&nbsp;{&nbsp;<span style="color: blue; ">return</span>&nbsp;<span style="color: rgb43, 145, 175; ">PropertyMetadata</span>.CompanyName.GetValue(<span style="color: blue; ">this</span>);&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">set</span>&nbsp;{&nbsp;<span style="color: rgb43, 145, 175; ">PropertyMetadata</span>.CompanyName.SetValue(<span style="color: blue; ">this</span>,&nbsp;<span style="color: blue; ">value</span>);&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;}</pre><pre style="font-family: C&#111;nsolas; font-size: 13px; : white; ">  }</pre><br ="Apple-interchange-newline"></div><div>Now let's say I have a ViewModel that has the following property to expose an entire customer.</div><div><br></div><div><pre style="font-family: C&#111;nsolas; font-size: 13px; : white; -: initial initial; -repeat: initial initial; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">public</span>&nbsp;<span style="color:#2b91af;">Customer</span>&nbsp;CustomerEntity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">get</span>&nbsp;{&nbsp;<span style="color:blue;">return</span>&nbsp;_customerEntity;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">set</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_customerEntity&nbsp;=&nbsp;<span style="color:blue;">value</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NotifyOfPropertyChange(()&nbsp;=&gt;&nbsp;CustomerEntity);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre></div><div>In the View you can then bind a TextBox to CompanyName like follows and the StringLengthVerifier on the CompanyName property will do it's job.</div><div><br></div><div><pre style="font-family: C&#111;nsolas; font-size: 13px; : white; -: initial initial; -repeat: initial initial; "><span style="color:#a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:blue;">&lt;</span><span style="color:#a31515;">TextBox</span><span style="color:red;">&nbsp;Text</span><span style="color:blue;">="{</span><span style="color:#a31515;">Binding</span><span style="color:red;">&nbsp;CustomerEntity</span><span style="color:blue;">.</span><span style="color:blue;">CompanyName</span><span style="color:blue;">,</span><span style="color:red;">&nbsp;ValidatesOnDataErrors</span><span style="color:blue;">=</span><span style="color:blue;">True</span><span style="color:blue;">}</span><span style="color:blue;">"</span><span style="color:blue;">&nbsp;/&gt;</span></pre></div>]]>
   </description>
   <pubDate>Wed, 15 Aug 2012 01:25:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14190#14190</guid>
  </item> 
  <item>
   <title>Automated string length validation : @Denis:Thank you for the code!...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14188#14188</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1500" rel="nofollow">harald</a><br /><strong>Subject:</strong> 3577<br /><strong>Posted:</strong> 14-Aug-2012 at 11:23pm<br /><br />@Denis:<br>Thank you for the code! That is very useful.<br><br><br>@mgood:<br>I don't understand your response. This is my 3rd week of working with your framework, so there's a lot I don't know/understand yet. (I do have 7+ years of experience with C# and WPF, tho. I am very well familiar with most WPF concepts).<br><br>Are you saying all I have to do is decorate my entity property in the view model with the StringLengthVerifier attribute and all string properties of my entity will be verified when I bind to them directly? I don't quite see how that would work...<br><br>I have a working solution, so a response is not urgent but if you feel like it, I'd be interested in a clarification in order to understand the issue better.<br><br><br>]]>
   </description>
   <pubDate>Tue, 14 Aug 2012 23:23:22 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14188#14188</guid>
  </item> 
  <item>
   <title>Automated string length validation : Hi Harald,Here&amp;#039;s a method...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14187#14187</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 3577<br /><strong>Posted:</strong> 14-Aug-2012 at 10:56pm<br /><br />Hi Harald,<div><br></div><div>Here's a method where you can pass in the entity type and property name and it will return the StringLengthVerifierAttribute.MaxValue.</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div><div>private int GetMaxLength(Type entityType, string propName) {</div><div>&nbsp; &nbsp; &nbsp; var entityMetadata = EntityMetadataStore.Instance.GetEntityMetadata(entityType);</div><div>&nbsp; &nbsp; &nbsp; var dataProp = entityMetadata.DataProperties.FirstOrDefault(dp =&gt; dp.Name == propName);</div><div>&nbsp; &nbsp; &nbsp; var stringLengthAttr = dataProp.PropertyInfo.GetCustomAttributes(typeof(IdeaBlade.Validation.StringLengthVerifierAttribute), false).FirstOrDefault();</div><div>&nbsp; &nbsp; &nbsp; if (stringLengthAttr != null) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return ((IdeaBlade.Validation.StringLengthVerifierAttribute)stringLengthAttr).MaxValue;</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; return 0;</div><div>}</div></div><div></pre></td></tr></table></div>]]>
   </description>
   <pubDate>Tue, 14 Aug 2012 22:56:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14187#14187</guid>
  </item> 
  <item>
   <title>Automated string length validation :   Originally posted by haraldHi...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14186#14186</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3577<br /><strong>Posted:</strong> 14-Aug-2012 at 5:06pm<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by harald</strong></em><br /><br />Hi Denis,<br><br>However, even if the StringLengthVerifierAttribute gets updated when I regenerate the model (which was news to me) it still is not a convenient solution as I'd need to generate a separate property in the viewmodel for each and every property of my entity and there are sometimes many of them.<br><br></td></tr></table><div><br></div><div>When you generate or update the model from the database, the DevForce code generator automatically decorates Entity properties with verifiers according to your DB schema. So for example string properties will be decorated with an&nbsp;appropriate&nbsp;StringLengthVerifier based on your DB schema.&nbsp;</div><div><br></div><div>Having said that, I don't understand why you would have to add properties to your viewmodel for each and every&nbsp;property&nbsp;of your entity. If you bind your entities directly the StringVerifiers on the properties will kick in whenever the user enters data.</div>]]>
   </description>
   <pubDate>Tue, 14 Aug 2012 17:06:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14186#14186</guid>
  </item> 
  <item>
   <title>Automated string length validation : Hi Denis,thanks for your swift...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14185#14185</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1500" rel="nofollow">harald</a><br /><strong>Subject:</strong> 3577<br /><strong>Posted:</strong> 14-Aug-2012 at 3:59pm<br /><br />Hi Denis,<br><br>thanks for your swift response.<br><br>I looked at the EntityMetadataStore documentation before I posted but I could not find any information about obtaining the max string length from it. I looked at all the fields (including DataEntityProperty) in the debugger but I could not find the max length anywhere.<br>Could you pls post or otherwise link to some code that shows how to obtain that info from the EntityMetadataStore?<br><br><br>Regarding StringLengthVerifierAttribute:<br><br>You are saying that when I decorate a property with something like:<br>&#091;IbVal.StringLengthVerifier(MaxValue=30, IsRequired=true,&nbsp; ErrorMessageResourceName="Employee_FirstName")&#093;<br>and I then regenerate the model this gets automatically updated in the code and it overwrites whatever I put into MaxValue?<br><br>However, even if the StringLengthVerifierAttribute gets updated when I regenerate the model (which was news to me) it still is not a convenient solution as I'd need to generate a separate property in the viewmodel for each and every property of my entity and there are sometimes many of them.<br><br>I rather bind to the entity properties directly in xaml.<br><br>I went ahead yesterday and used reflection (found the code snippet here on the forum) in a value converter to obtain it.<br>It works and I like that it is a pure xaml solution but I'd still be interested in obtaining this (and other) information from the EntityMetadataStore if you would be so kind and point me in the right direction.<br><br><br>]]>
   </description>
   <pubDate>Tue, 14 Aug 2012 15:59:33 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14185#14185</guid>
  </item> 
  <item>
   <title>Automated string length validation : Hi Harald,DevForce provides EntityMetadataStore...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14183#14183</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 3577<br /><strong>Posted:</strong> 14-Aug-2012 at 1:21pm<br /><br />Hi Harald,<div><br></div><div>DevForce provides EntityMetadataStore for such use case. See&nbsp;<a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/model-examine" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/model-examine</a>&nbsp;for more info.</div><div><br></div><div>I'm curious though. You can skip doing all this if you just update and regenerate your model from the DB. DevForce code generation will automatically update the MaxLength for all your StringLengthVerifierAttribute.</div><div><br></div><div>Please let me know if I'm missing something.</div>]]>
   </description>
   <pubDate>Tue, 14 Aug 2012 13:21:25 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14183#14183</guid>
  </item> 
  <item>
   <title>Automated string length validation : I am aware of your StringLengthVerifier...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14180#14180</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1500" rel="nofollow">harald</a><br /><strong>Subject:</strong> 3577<br /><strong>Posted:</strong> 13-Aug-2012 at 6:11pm<br /><br />I am aware of your StringLengthVerifier and its MaxValue attribute.<br>The problem we have is that when we change the field length in the database we have to modify the MaxValue attribute of all relevant verifiers. This is not a good solution. Too much possibility for errors.<br><br>I am trying to automate this.<br><br>My idea is to create a value converter that receives the type of the property as input and returns the field length of the property. Then I can use the converter for the MaxLength property of a TextBox like this:<br><br><!--if gte mso 9> <w:Word>  <w:View>Normal</w:View>  <w:Zoom>0</w:Zoom>  <w:TrackMoves/>  <w:Trackatting/>  <w:Punctuati&#111;nKerning/>  <w:ValidateAgainstSchemas/>  <w:SaveIfInvalid>false</w:SaveIfInvalid>  <w:IgnoreMixed>false</w:IgnoreMixed>  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>  <w:D&#111;notPromoteQF/>  <w:LidThemeOther>EN-AU</w:LidThemeOther>  <w:LidThemeAsian>X-NONE</w:LidThemeAsian>  <w:LidThemeComplex>X-NONE</w:LidThemeComplex>  <w:Compatibility>   <w:BreakWrappedTables/>   <w:SnapToGridInCell/>   <w:WrapTextWithPunct/>   <w:UseAsianBreakRules/>   <w:D&#111;ntGrowAutofit/>   <w:SplitPgBreakAndark/>   <w:EnableKerning/>   <w:D&#111;ntFlipMirrorIndents/>   <w:OverrideTableStyleHps/>  </w:Compatibility>  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>  <m:mathPr>   <m:mathFont m:val="Cambria Math"/>   <m:brkBin m:val="before"/>   <m:brkBinSub m:val="&amp;#45;-"/>   <m:smallFrac m:val="off"/>   <m:dispDef/>   <m:lMargin m:val="0"/>   <m:rMargin m:val="0"/>   <m:defJc m:val="centerGroup"/>   <m:wrapIndent m:val="1440"/>   <m:intLim m:val="subSup"/>   <m:naryLim m:val="undOvr"/>  </m:mathPr></w:Word><!--><!--if gte mso 9> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"    DefSemi="true" DefQat="false" DefPriority="99"    LatentStyleCount="267">  <w:LsdExcepti&#111;n Locked="false" Priority="0" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="Normal"/>  <w:LsdExcepti&#111;n Locked="false" Priority="9" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="ing 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="9" Qat="true" Name="ing 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="9" Qat="true" Name="ing 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="9" Qat="true" Name="ing 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="9" Qat="true" Name="ing 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="9" Qat="true" Name="ing 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="9" Qat="true" Name="ing 7"/>  <w:LsdExcepti&#111;n Locked="false" Priority="9" Qat="true" Name="ing 8"/>  <w:LsdExcepti&#111;n Locked="false" Priority="9" Qat="true" Name="ing 9"/>  <w:LsdExcepti&#111;n Locked="false" Priority="39" Name="toc 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="39" Name="toc 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="39" Name="toc 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="39" Name="toc 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="39" Name="toc 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="39" Name="toc 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="39" Name="toc 7"/>  <w:LsdExcepti&#111;n Locked="false" Priority="39" Name="toc 8"/>  <w:LsdExcepti&#111;n Locked="false" Priority="39" Name="toc 9"/>  <w:LsdExcepti&#111;n Locked="false" Priority="35" Qat="true" Name="capti&#111;n"/>  <w:LsdExcepti&#111;n Locked="false" Priority="10" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="Title"/>  <w:LsdExcepti&#111;n Locked="false" Priority="1" Name="Default Paragraph Font"/>  <w:LsdExcepti&#111;n Locked="false" Priority="11" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="Subtitle"/>  <w:LsdExcepti&#111;n Locked="false" Priority="22" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="Str&#111;ng"/>  <w:LsdExcepti&#111;n Locked="false" Priority="20" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="Emphasis"/>  <w:LsdExcepti&#111;n Locked="false" Priority="59" Semi="false"     UnhideWhenUsed="false" Name="Table Grid"/>  <w:LsdExcepti&#111;n Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>  <w:LsdExcepti&#111;n Locked="false" Priority="1" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="No Spacing"/>  <w:LsdExcepti&#111;n Locked="false" Priority="60" Semi="false"     UnhideWhenUsed="false" Name="Light Shading"/>  <w:LsdExcepti&#111;n Locked="false" Priority="61" Semi="false"     UnhideWhenUsed="false" Name="Light List"/>  <w:LsdExcepti&#111;n Locked="false" Priority="62" Semi="false"     UnhideWhenUsed="false" Name="Light Grid"/>  <w:LsdExcepti&#111;n Locked="false" Priority="63" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="64" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="65" Semi="false"     UnhideWhenUsed="false" Name="Medium List 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="66" Semi="false"     UnhideWhenUsed="false" Name="Medium List 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="67" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="68" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="69" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="70" Semi="false"     UnhideWhenUsed="false" Name="Dark List"/>  <w:LsdExcepti&#111;n Locked="false" Priority="71" Semi="false"     UnhideWhenUsed="false" Name="Colorful Shading"/>  <w:LsdExcepti&#111;n Locked="false" Priority="72" Semi="false"     UnhideWhenUsed="false" Name="Colorful List"/>  <w:LsdExcepti&#111;n Locked="false" Priority="73" Semi="false"     UnhideWhenUsed="false" Name="Colorful Grid"/>  <w:LsdExcepti&#111;n Locked="false" Priority="60" Semi="false"     UnhideWhenUsed="false" Name="Light Shading Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="61" Semi="false"     UnhideWhenUsed="false" Name="Light List Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="62" Semi="false"     UnhideWhenUsed="false" Name="Light Grid Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="63" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="64" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="65" Semi="false"     UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" UnhideWhenUsed="false" Name="Revisi&#111;n"/>  <w:LsdExcepti&#111;n Locked="false" Priority="34" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="List Paragraph"/>  <w:LsdExcepti&#111;n Locked="false" Priority="29" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="Quote"/>  <w:LsdExcepti&#111;n Locked="false" Priority="30" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="Intense Quote"/>  <w:LsdExcepti&#111;n Locked="false" Priority="66" Semi="false"     UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="67" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="68" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="69" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="70" Semi="false"     UnhideWhenUsed="false" Name="Dark List Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="71" Semi="false"     UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="72" Semi="false"     UnhideWhenUsed="false" Name="Colorful List Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="73" Semi="false"     UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>  <w:LsdExcepti&#111;n Locked="false" Priority="60" Semi="false"     UnhideWhenUsed="false" Name="Light Shading Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="61" Semi="false"     UnhideWhenUsed="false" Name="Light List Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="62" Semi="false"     UnhideWhenUsed="false" Name="Light Grid Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="63" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="64" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="65" Semi="false"     UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="66" Semi="false"     UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="67" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="68" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="69" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="70" Semi="false"     UnhideWhenUsed="false" Name="Dark List Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="71" Semi="false"     UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="72" Semi="false"     UnhideWhenUsed="false" Name="Colorful List Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="73" Semi="false"     UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>  <w:LsdExcepti&#111;n Locked="false" Priority="60" Semi="false"     UnhideWhenUsed="false" Name="Light Shading Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="61" Semi="false"     UnhideWhenUsed="false" Name="Light List Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="62" Semi="false"     UnhideWhenUsed="false" Name="Light Grid Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="63" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="64" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="65" Semi="false"     UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="66" Semi="false"     UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="67" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="68" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="69" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="70" Semi="false"     UnhideWhenUsed="false" Name="Dark List Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="71" Semi="false"     UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="72" Semi="false"     UnhideWhenUsed="false" Name="Colorful List Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="73" Semi="false"     UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>  <w:LsdExcepti&#111;n Locked="false" Priority="60" Semi="false"     UnhideWhenUsed="false" Name="Light Shading Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="61" Semi="false"     UnhideWhenUsed="false" Name="Light List Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="62" Semi="false"     UnhideWhenUsed="false" Name="Light Grid Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="63" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="64" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="65" Semi="false"     UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="66" Semi="false"     UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="67" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="68" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="69" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="70" Semi="false"     UnhideWhenUsed="false" Name="Dark List Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="71" Semi="false"     UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="72" Semi="false"     UnhideWhenUsed="false" Name="Colorful List Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="73" Semi="false"     UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>  <w:LsdExcepti&#111;n Locked="false" Priority="60" Semi="false"     UnhideWhenUsed="false" Name="Light Shading Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="61" Semi="false"     UnhideWhenUsed="false" Name="Light List Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="62" Semi="false"     UnhideWhenUsed="false" Name="Light Grid Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="63" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="64" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="65" Semi="false"     UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="66" Semi="false"     UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="67" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="68" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="69" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="70" Semi="false"     UnhideWhenUsed="false" Name="Dark List Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="71" Semi="false"     UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="72" Semi="false"     UnhideWhenUsed="false" Name="Colorful List Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="73" Semi="false"     UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>  <w:LsdExcepti&#111;n Locked="false" Priority="60" Semi="false"     UnhideWhenUsed="false" Name="Light Shading Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="61" Semi="false"     UnhideWhenUsed="false" Name="Light List Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="62" Semi="false"     UnhideWhenUsed="false" Name="Light Grid Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="63" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="64" Semi="false"     UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="65" Semi="false"     UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="66" Semi="false"     UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="67" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="68" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="69" Semi="false"     UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="70" Semi="false"     UnhideWhenUsed="false" Name="Dark List Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="71" Semi="false"     UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="72" Semi="false"     UnhideWhenUsed="false" Name="Colorful List Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="73" Semi="false"     UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>  <w:LsdExcepti&#111;n Locked="false" Priority="19" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="Subtle Emphasis"/>  <w:LsdExcepti&#111;n Locked="false" Priority="21" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="Intense Emphasis"/>  <w:LsdExcepti&#111;n Locked="false" Priority="31" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="Subtle Reference"/>  <w:LsdExcepti&#111;n Locked="false" Priority="32" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="Intense Reference"/>  <w:LsdExcepti&#111;n Locked="false" Priority="33" Semi="false"     UnhideWhenUsed="false" Qat="true" Name="Book Title"/>  <w:LsdExcepti&#111;n Locked="false" Priority="37" Name="Bibliography"/>  <w:LsdExcepti&#111;n Locked="false" Priority="39" Qat="true" Name="TOC ing"/> </w:LatentStyles><!--><!--if gte mso 10> /* Style Definitions */ table.MsoNormalTable	{mso-style-name:"Table Normal";	mso-tstyle-rowband-size:0;	mso-tstyle-colband-size:0;	mso-style-noshow:yes;	mso-style-priority:99;	mso-style-parent:"";	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;	mso-para-margin:0cm;	mso-para-margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:10.0pt;	font-family:"Times New Roman","serif";}<!--><span style="font-size:12.0pt;font-family:C&#111;nsolas;  mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;color:red;  mso-ansi-:EN-AU;mso-fareast-:EN-AU;mso-bidi-:AR-SA">MaxLength</span><span style="font-size:12.0pt;font-family:C&#111;nsolas;mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;color:blue;mso-ansi-:EN-AU;  mso-fareast-:EN-AU;mso-bidi-:AR-SA">="{</span><span style="font-size:12.0pt;font-family:C&#111;nsolas;mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;color:#A31515;mso-ansi-:EN-AU;  mso-fareast-:EN-AU;mso-bidi-:AR-SA">Binding</span><span style="font-size:12.0pt;font-family:C&#111;nsolas;mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;color:red;mso-ansi-:EN-AU;  mso-fareast-:EN-AU;mso-bidi-:AR-SA"> Client</span><span style="font-size:12.0pt;font-family:C&#111;nsolas;mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;color:blue;mso-ansi-:EN-AU;  mso-fareast-:EN-AU;mso-bidi-:AR-SA">.clt_name,</span><span style="font-size:12.0pt;font-family:C&#111;nsolas;mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;color:red;mso-ansi-:EN-AU;  mso-fareast-:EN-AU;mso-bidi-:AR-SA">&nbsp;Converter</span><span style="font-size:12.0pt;font-family:C&#111;nsolas;mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;color:blue;mso-ansi-:EN-AU;  mso-fareast-:EN-AU;mso-bidi-:AR-SA">={</span><span style="font-size:12.0pt;font-family:C&#111;nsolas;mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;color:#A31515;mso-ansi-:EN-AU;  mso-fareast-:EN-AU;mso-bidi-:AR-SA">StaticResource</span><span style="font-size:12.0pt;font-family:C&#111;nsolas;mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;color:red;mso-ansi-:EN-AU;  mso-fareast-:EN-AU;mso-bidi-:AR-SA">&nbsp;LengthConverter</span><span style="font-size:12.0pt;font-family:C&#111;nsolas;mso-fareast-font-family:Calibri;  mso-fareast-theme-font:minor-latin;color:blue;mso-ansi-:EN-AU;  mso-fareast-:EN-AU;mso-bidi-:AR-SA">}}"</span><br><br>I have not written it yet (it probably needs a parameter that receives the type of the property, so I can use reflection to determine the field length or something along those lines).<br><br>However, this is an everyday problem for DB UI developers and I am hoping you have a much better solution already ready for me to use.<br><br>If not, can you point me to how to use your EntityManager and your VerifierEngine in the converter such that it returns the field length for a property (given by name, like "Client.clt_name")?<br><br>Thanks!<br><br>]]>
   </description>
   <pubDate>Mon, 13 Aug 2012 18:11:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3577&amp;PID=14180#14180</guid>
  </item> 
 </channel>
</rss>