title: Applying RegexValidator (Microsoft.Practices.EnterpriseLibrary.Validation.Validators) attribute to a decimal type?
body: <p><strong>Motive</strong> : I have a decimal property in a class which I wish to validate so that it adheres to regex "^\d{1,7}.\d{2,7}$" </p>
  
  <p>So i have applied the Regex validator attribute to the property</p>
  
  <pre><code>   [RegexValidator(@"^\d{1,7}\.\d{2,7}$"...)]
     public Decimal MyDecimalProperty { get; set; }
  </code></pre>
  
  <p>Then, via propertyproxyvalidator on my asp.net page i have tied a textbox validation to this property type.</p>
  
  <pre><code>&lt;cc1:PropertyProxyValidator ID="MyValidator" runat="server" ControlToValidate="MyTextBox"
  PropertyName="MyDecimalProperty" SourceTypeName="Myclass, Mydll"&gt;&lt;/cc1:PropertyProxyValidator&gt;
  </code></pre>
  
  <p>At runtime i get this error when validation gets performed: </p>
  
  <blockquote>
    <p>"Value to validate is not of the
    expected type: expected System.String
    but got System.Decimal instead."</p>
  </blockquote>
  
  <p>Any idea how to get around this issue, or an alternate to achieve my motive ?</p>