Unable to set property 'MaxLength' on object of type 'Radzen.Blazor.RadzenTextBox'. The error was: Specified cast is not valid

I am doing dynamically built components due to having a dynamic schema that we are using to generate the form.

builder.OpenComponent(0);
builder.AddAttribute(1, "Value", displayValue);
if(hasMaxLength)
{
builder.AddAttribute(2, "MaxLength", (int)maxLength);
}


I've tried everything to make sure that the maxLength is going in as an "int" but it seems to be getting converted to a string still, which is causing this error:

Unhandled exception rendering component: Unable to set property 'MaxLength' on object of type 'Radzen.Blazor.RadzenTextBox'. The error was: Specified cast is not valid.
System.InvalidOperationException: Unable to set property 'MaxLength' on object of type 'Radzen.Blazor.RadzenTextBox'. The error was: Specified cast is not valid.

Hey @zasage,

This property is nullable long not int: