Hello RadZen Team,
i have many database defaults especially for bit (checkboxes) columns with NOT NULL constraints. i see that RadZen didnt remember these defaults while creating pages. so im forced to add a default values manually to every page. this is very time consuming. Is there an easier way to solve this?
Indeed at the moment Radzen will check only NOT NULL constraints and not default values from SQL. There is a way however to describe default values with EF Core and we will include fix for this in our next release (next week).
Just to let you know that Radzen 1.32.3 is already released with default values support included (properties with default values will not be required anymore when trying to add new records). For .NET Core 2.x projects also Radzen will use Fluent API to describe relations in order to avoid Data Annotations regressions in EF Core 2.0.
Please regenerate your app if you want to use default values or .NET Core 2.x.
1.32.3 is the latest version. Just close the update message and Radzen will work as expected. We will investigate for any issues with the update server.
Hi Artanas,
i freshly generated a new app with Radzen 1.32.3 from scratch. The Database Defaults didnt work. the required messages came up as before. although i see that the defaults are generated
Its clear that i can do that with the DeafultValue property in Radzen... but what an effort
I have around 100 defaults in my database... and there are many of them which are only with default as an easement for users.
E.g. the Leihfahrzeug is in 80% of adding a new Fahrzeug false. When i do not set the DefaultValue in Radzen users must set Leihfahrzeug manually to false.
Hi Vladimir,
yes. i know. i have several defaults that works like this and i make them invisible on the add page. But there are much more default values in the database that must be shown to the user while adding a record. It is because the user must have the choice to change them before submitting.
E.g. the “Leihfahrzeug” field is in 80% of adding a new Fahrzeug “false”. But in around 20% true. So i wish to show the user the most propably value. I cant submit the default value as it is… the user must decide.
Hi Vladimir,
Ok. I see the problem. The values must be converted for each database system.
Other way… can i set the default value programmatically before the add page is shown? Perhaps on the server side in the Controller? With a partial class? I see the “partial void OnFahrzeugCreated(Models.Eschadendb.Fahrzeug item);”
Something like this?