This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I get an error when I want to make changes (CUD) to a child table that is linked to a main table. Apparently there are blank master lines when I bind the child table to a datagrid. He run this code in the auto created model.cs file for each visible line in the datagrid (11 times):
public EntityCollection<Dossier> Dossiers
{ get { return Get(_dossiers); }
}
|
|
|
The validation message should tell you which fields are required but are not filled in. Depending on the application requirements and database design, you can either remove the presence validation from those fields, or initialise them to suitable values (via a constructor in a partial class). |
|
|
I don't think you fully understand the problem. Table 2 : tbl_Vehicle This tables are linked by tbl_File.VehicleID and tbl_Vehicle.ID Now when i bind tbl_Vehicle to a datagrid, the linked files are requested from tbl_File (this is not neccesary because i only want to add / edit a vehicle.) Thanks in advance. Pieter
|
|
|
This sounds a like a bug in the data grid. LightSpeed will load the File objects only when something asks it to do so (unless you mark Vehicle.Files as "eager load"). And LightSpeed will never add items to the Vehicle.Files collection of its own accord. So I think the requests to load the Files collection and to add an empty record to the Files collection must be coming from somewhere inside the data grid. The request to load the Files collection may be because the data grid doesn't recognise Files as a collection property and is trying to display it in a Files column. I don't know why the grid would want to add a record whenever it sees an empty collection. That just seems like a bug. The fix may be to configure the data grid not to show the Files column. Hopefully this will also stop it wanting to add stuff to the collection. Failing that, you probably need to investigate this with the manufacturer of the data grid control; we'll be happy to work with them if they need any info from us. |
|