Completed
Last Updated: 14 Apr 2020 15:40 by ADMIN
Release 2.11.0
Gordon
Created on: 06 Oct 2019 10:18
Category: Grid
Type: Feature Request
5
Setting default values in new row

Is there any way to default the values that are used when I create a new row?

So for example, I have a row where I want to default a date to Jan 1st of the following year.  However, when I add the row, it adds nulls to all fields and the date shows up as 1 Jan 1900 and there's a lot of fiddly clicking to set the right date.

2 comments
ADMIN
Marin Bratanov
Posted on: 14 Apr 2020 15:39

Hi everyone,

The best way to do this is to set the defaults in the model so the grid can read them. Here's an example: https://docs.telerik.com/blazor-ui/knowledge-base/grid-default-value-for-new-row

An alternative would be to go through the grid state and custom command buttons so you can set the desired model instance to be edited/inserted. Here's an example of that: https://docs.telerik.com/blazor-ui/components/grid/state#initiate-editing-or-inserting-of-an-item

 

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
René
Posted on: 27 Nov 2019 10:54
As a workaround you can set default values in the EditorTemplate.