Validation with ideablade & telerik

2 posts, 0 answers
  1. Paolo
    Paolo avatar
    423 posts
    Member since:
    Jun 2009

    Posted 12 Dec 2012 Link to this post

    Hello,
    I've got a question on validation with telerik and ideablade's devforce...
    Suppose I've got a simple object defined as

    /// <summary>The auto-generated TAGS class. </summary>
     [DataContract(IsReference=true)]
     [IbEm.DataSourceKeyName(@"AdminEntities")]
     [IbEm.DefaultEntitySetName(@"AdminEntities.TAGS")]
     public partial class TAGS : IbEm.Entity {
     
       /// <summary>Returns the property path for the given expression. </summary>
       /// <example>
       /// Usage:
       /// <code>
       ///    var r = Employee.PathFor(e => e.Manager.City); // returns "Manager.City"
       /// </code>
       /// </example>
       public static string PathFor(System.Linq.Expressions.Expression<System.Func<TAGS, object>> expr) {
         return IbCore.PropertyPath.For<TAGS>(expr);
       }
     
       #region Data Properties
     
       /// <summary>Gets or sets the ID. </summary>
       [Key]
       [DataMember]
       [Bindable(true, BindingDirection.TwoWay)]
       [Editable(true)]
       [Display(Name="ID", AutoGenerateField=true)]
       [IbVal.RequiredValueVerifier( ErrorMessageResourceName="TAGS_ID")]
       public int ID {
         get { return PropertyMetadata.ID.GetValue(this); }
         set { PropertyMetadata.ID.SetValue(this, value); }
       }
     
       /// <summary>Gets or sets the NOME. </summary>
       [DataMember]
       [DefaultValue("")]
       [Bindable(true, BindingDirection.TwoWay)]
       [Editable(true)]
       [Display(Name="NOME", AutoGenerateField=true)]
       [IbVal.StringLengthVerifier(MaxValue=50, IsRequired=true, ErrorMessageResourceName="TAGS_NOME")]
       public string NOME {
         get { return PropertyMetadata.NOME.GetValue(this); }
         set { PropertyMetadata.NOME.SetValue(this, value); }
       }
     
       /// <summary>Gets or sets the COLORE. </summary>
       [DataMember]
       [Bindable(true, BindingDirection.TwoWay)]
       [Editable(true)]
       [Display(Name="COLORE", AutoGenerateField=true)]
       [IbVal.StringLengthVerifier(MaxValue=16, IsRequired=true, ErrorMessageResourceName="TAGS_COLORE")]
       public string COLORE {
         get { return PropertyMetadata.COLORE.GetValue(this); }
         set { PropertyMetadata.COLORE.SetValue(this, value); }
       }
       #endregion Data Properties

    (That's generated from Ideablade edmx)

    when I add a new item within a RadDataForm I got that the NOME field is empty ("") but when I hit tab key I got no message saying it's not valid... if I put another value for example "text", then tab, then I re-empty the field I got this time the message saying "NOME field is required"...how can I've this one fired at the first empty tab?
    Thanks in advance
    Paolo
  2. Yoan
    Admin
    Yoan avatar
    1068 posts

    Posted 14 Dec 2012 Link to this post

    Hello Paolo,

    I am not sure that RadDataForm can use this IdeaBlade's attribute - [IbVal.StringLengthVerifier(MaxValue=50, IsRequired=true,ErrorMessageResourceName="TAGS_NOME")].

    May I ask you to create a dummy project and send it to me?

    Thank you in advance.

    Greetings,
    Yoan
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top