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?