Silverlight validation with DataAnnotation -
my problem following:
i have childwindow gets entity editable.
i use dataannotation attributes set validation rules.
my entity has name property , required attribute applied on it.
if modify existing entity , clear textbox binding name property validation error name field required.
but when add new entity , name property null validation doesn't work.
i set name property string.empty in constructor of class , display entity in childwindow validation error showing in textbox.
what best solution?
can set button showing childwindow doesn't fire validation?
in asp.net button control has iscausesvalidation property false button doesn't fire validation.
thanks advance l,
what trying achieve? validation exception won't thrown until set property via setter on underlying bound object. want validation errors displayed when user first enters data entry form? using data form? if should able validate entire form @ time of saving data e.g.
private void okbutton_click(object sender, routedeventargs e) { bool valid = mydataform.validateitem(); if (valid) { mydataform.commitedit(true); this.dialogresult = true; } }
Comments
Post a Comment