This is a migrated thread and some comments may be shown as answers.

Validation with ideablade & telerik

1 Answer 49 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 12 Dec 2012, 07:59 AM
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

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 14 Dec 2012, 01:35 PM
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.

Tags
General Discussions
Asked by
Michele
Top achievements
Rank 2
Answers by
Yoan
Telerik team
Share this question
or