iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi
I use Client UI MVVM Data Application with RIA Services. I have added Atributes on Metadata Class, eg. DataAnnotations.RequiredAttribute
[Required(ErrorMessage = "Eingabe erforderlich!")] [StringLength(250, ErrorMessage = "Es sind max. 250 Zeichen erlaubt!")] public string FQDN { get; set; }
When the Cell is empty, I get the Errormessage in UXGridView Footer and the row has a red background color. Please have a look at attached picture (1). This works fine.
Now, I have to validate also on server side. In my case, the FQDN must be unique. So I have writ following method:
public bool IsComputerFQDNRegistered(string fqdn) { return _qmsEntities.Computer.Where(c => c.FQDN == fqdn).Count() > 0; }
In Insert and Update method, I call IsComputerFQDNRegistered, like this:
public void InsertComputer(Computer computer) { if (IsComputerFQDNRegistered(computer.FQDN)) { ValidationResult error = new ValidationResult("FQDN ist bereits vorhanden!", new string[] { "FQDN" }); throw new ValidationException(error, null, computer); } if ((computer.EntityState != EntityState.Detached)) { _qmsEntities.ObjectStateManager.ChangeObjectState(computer, EntityState.Added); } else { _qmsEntities.Computer.AddObject(computer); } }
Now I change one FQDN in UXGridView and leave the row to save the changes. I get a Errormessage (see UXGridViewErrorMessageValitationError.png). I would like display the ValidationResult ErrorMessage (FQDN ist bereits vorhanden). Where can I find this Info?
After clicking OK on Errormessage, I can not see any errors in UXGridView. Only when I mark the row (with Errors) and change in edit mode, the Errormessage will displayed. But in the UXGridView Footer I can not see the message (please have a look at attached picture (2)). It is possible to change this behavoir? It would be great, when the background color would be red.
Thanks for help
Michael
In order to perform data validation to the particular changes, you can implement it by handling the ValidateRow command in the ViewModel. In addition, you can also add custom logic when the row changes are canceled by handling the RejectRow command.
So, instead of implement the data validation in Insert and Update method, I suggest you to implement it in ValidateRow command.
For more detail information, please check the ClientUI documentation inside “Editing Data with UXGridView” topic.
Hi Yudi
The data validation is on serverside (ria service class).
I’m currently still investigating this issue and need more time to provide you with solution, suggestion, or sample.
I’ll get back to you as soon as possible.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname