as I said in my first post I would like to put a specific value in a cell of the ECR column when I click on the Add ECR button.
The structure of my application is as follow :
Fetch.razor where there is a button Add ECR
<div class="form-group">
<a class="btn btn-primary" href="developer/create">Add ECR</a>
</div>
developer/create
@page "/developer/create"
@inject HttpClient http
@inject NavigationManager uriHelper
<FormCreate ButtonText="Create Developer" dev="@dev"
OnValidSubmit="@CreateDeveloper"/>
@code {
Developer dev = new Developer();
async Task CreateDeveloper()
{
await http.PostAsJsonAsync("api/developer", dev);
uriHelper.NavigateTo("developer");
}
}
FormCreate.razor
<EditForm Model="@dev" OnValidSubmit="@OnValidSubmit">
<DataAnnotationsValidator />
<RadzenFieldset Text="Creation ECR">
<div class="row">
<div class="col-md-4 align-items-center d-flex">
<RadzenLabel Text="Numéro ECR" />
</div>
<div class="col-md-6">
<RadzenTextBox style="width: 100%;" Name="Numéro ECR" @bind-Value=@IncrementECR()>
</RadzenTextBox>
<ValidationMessage For="@(() => dev.ECR)" />
</div>
</div>
...
</RadzenFieldset>
</EditForm>
when I click on Add ECR I would like to fill the TexBox with the specifier value eg 001/22. Each time I click on Add ECR this value is incremented 001/22; 002/22; ...100/22...
When the year change (eg 2023) I want to initialize the value at 001/23...