New Posts New Posts RSS Feed: Verification not triggering
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Verification not triggering

 Post Reply Post Reply
Author
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Topic: Verification not triggering
    Posted: 28-Sep-2013 at 7:28am
My code was foobar - I was setting the Attributes on the Ext field instead of the AreaCode field.


In any case, it's working now.

Greg
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 27-Sep-2013 at 4:32pm

Your binding is to Item.AreaCode.  Does that property have similar validation attributes?

Back to Top
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Posted: 27-Sep-2013 at 9:45am
I am trying to get Verification to work correctly on a CodeFirst project. Currently, I am not getting a red textbox, or a popup when the validation should fail. Perhaps there is a switch somewhere that I have not set to trigger the validation.

For example on a Phone Number entity:

        [DataMember]
        [Column("Ext")]
        [Bindable(true, BindingDirection.TwoWay)]
        [Editable(true)]
        [Display(Name = "Ext", AutoGenerateField = true)]
        [StringLength(3, MinimumLength = 3)]
        public string Ext
        {
            get;
            set;
        }

Then in the Textbox, it has the appropriate bindings:

<TextBox IsReadOnly="{Binding IsReadOnly}"
Text="{Binding Item.AreaCode, Mode=TwoWay, ValidatesOnDataErrors=True,
ValidatesOnExceptions=True,                                           UpdateSourceTrigger=PropertyChanged}" />

It seems to me this should be working.

Greg

Edited by gregweb - 27-Sep-2013 at 9:46am
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down