I am having difficulty implementing a custom Telerik Numerical Textbox component in a Blazor application, specifically with setting up two-way data binding.
In my Razor page, I'm trying to use the custom component like so:
<CustomNumericalTextBox Id="ID" Format="P" Min="0" Max="1" Step="0.01m" @Bind-Value="@Model.Value1" />
In the code-behind of this page, I have a model class:
public class Model
{
public decimal Value1 { get; set; } = "Something"
}
The custom component is defined in a separate Razor page:
@inherits CustomNumericalTextBoxBase
<FormItem>
<Template>
<TelerikNumericalTextBox Id="@Id" Format="@Format" Min="@Min" Max="@Max" @bind-Value="@BindValue">
</TelerikNumericalTextBox>
</Template>
</FormItem>
public class CustomNumericalTextBox
{
[Parameter]
public decimal BindValue { get; set; }
[Parameter]
public EventCallback<decimal> BindValueChanged { get; set; }
[Parameter]
public string Format { get; set; } = string.Empty;
[Parameter]
public string Min { get; set; } = "0";
[Parameter]
public string Max { get; set; } = "1";
[Parameter]
public string Id { get; set; }
}
The errors I receive are:
'CustomNumericalTextBox.BuildRederTree(RederTreeBuilder)': No suitable method found to override
'CustomNumericalTextBox.BuildRederTree(RederTreeBuilder)': No suitable method found to override
The attribute names could not be inferred from bind attribute 'bind-BindValue'. Bind attributes should be of the form 'bind' or 'bind-value' along with their corresponding optional parameters like 'bind-value:event', 'bind:format' etc.