How to bind textbox with format?

Using TextBox

How to have the same feature,

 @bind:format="yyyy-MM-dd"

detail as follows,

@page "/date-binding"

<p>
    <label>
        <code>yyyy-MM-dd</code> format:
        <input @bind="startDate" @bind:format="yyyy-MM-dd" />
    </label>
</p>

<p>
    <code>startDate</code>: @startDate
</p>

@code {
    private DateTime startDate = new(2020, 1, 1);
}

You cannot bind DateTime to RadzenTextBox Value. For DateTime you can use RadzenDatePicker:

<RadzenDatePicker @bind-Value="startDate" DateFormat="yyyy-MM-dd" />
1 Like