Selected string to DataPicker (DateTime)

Hello, I am a beginner in C# and have the following problem:
This column has ValidFromStr property and is created as a string


I'm trying to pass the selected value into datapicker and I'm getting errors.
With RadzenTextBox it works without any problems because it has a string value.

What is the best way to convert the value?
Property for ValidFrom:
public DateOnly? ValidFrom { get; set; }
public string? ValidFromStr
{
get => this.ValidFrom?.ToShortDateString();
set => this.ValidFrom = string.IsNullOrWhiteSpace( value ) ? null : DateOnly.Parse( value );
}

Hi @LMGeds,

You can't use RadzenDatePicker with a string property. It needs DateTime or DateTimeOffset. You can add another property to your model which converts from and to string.

Thank you for a quick reply.