New Posts New Posts RSS Feed: Validation of new records?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Validation of new records?

 Post Reply Post Reply
Author
mseeli View Drop Down
Newbie
Newbie
Avatar

Joined: 20-Sep-2010
Location: Switzerland
Posts: 31
Post Options Post Options   Quote mseeli Quote  Post ReplyReply Direct Link To This Post Topic: Validation of new records?
    Posted: 08-Jun-2011 at 8:57am
Can someone explain the following behavoiur?

In a DevForce Silverlight 4 application I have an entity that has a not nullable field called "Name" (amoung others)

In my Viewmodel I use a async query to get the data from the server and then I fill the results into an ObervableCollection<T> which is then bound to a Grid (Itemsource) on the view

That works fine, the records appear in the grid and I can edit them. When I delete the content of the Field "Name" it turns red and an error message pops up. Just as one would expect.

I then go and add a new Entity to my Collection, so that it ends up in the database

Manager ist my EntityManager, Persons is my ObservableCollection<Person> that is bound to the grid

I do something like this:

            var et = new Person();
            et.Id = Guid.NewGuid();
            et.Name = "New Name";
            Manager.AddEntity(et);
            Persons.Add(et);

The new Person shows up in the grid and when I do a SaveAsync later it also ends up in my database.
What is strange and what I don't quite understand is that when I go and delete the content of the Field Name
in the newly created person - no error shows up

It seems a entity has to be saved first before it is validated.

What is the reason for this behaviour?

1. A bug in the DevExpress Grid that I am using?
2. A bug somewhere else in my code?
3. A bug in DevForce?
4. Or is this the normal behaviour and I have to do something extra to get 
it to validate a freshly added record?

can you enlighten me?
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 13-Jun-2011 at 12:14pm
Hi mseeli,
 
I am taking a look at this and will follow up shortly.
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 27-Jun-2011 at 5:18pm
Hi meeli,
I was not able to reproduce your issue here. Can you provide a test solution demonstrating the problem?
Attached is my test solution. (using sdk datagrid) In it, after I add a new record, it validates properly if I delete data from a non-nullable field. (before or after the save)
uploads/892/SLDataValidation.zip
Kind regards,
Silvio.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down