I may have found a bug in the latest version using an Angular client:
- create an SQL Server database with simple Project and ProjectTask master and detail tables (both having an integer identity PK called Id and ProjectTask having a ProjectId FK)
- populate the two tables with some sample data directly in the database
- create a brand new RadZen app with an SQL Server datasource
- add a new Master/Detail grid page
- allow Add on both Grid0 and Grid1 (default names for the two grids)
- run the application
You can add and edit Projects, but you can only edit ProjectTasks. When you try to add a new Project task you simply get a red "Unable to create new ProjectTask!" popup error.
There are no console errors, but the network error indicates a 400 Bad Request error. When you put a breakpoint in the backend controller it appears that the submitted request is null.
Digging some more... this is what an Edit request looks like:
{"Id":1,"ProjectId":1,"SortOrder":1,"Title":"My First Task","Description":"My First Description","IsCompleted":false}
But this is what a Create request looks like:
{"SortOrder":2,"Title":"New Add","Description":"Adding this new project task","IsCompleted":true,"ProjectId":"1"}
It appears to me that RadZen incorrectly passes the ProjectId FK as a string during the create request whereas it is correctly passes as an integer during the edit request.
Thanks for your help