Adding FormItem inside the FormItems got System.ArgumentNullException: Value cannot be null. (Parameter 'For') when rendering
This is my code of course the Model and EditContext will be different.
<TelerikForm Model="FarsDetailSate.Model"@
ref="FormReference"
EditContext="FarsDetailSate.EditContext"
Size="@ThemeConstants.Form.Size.Medium"
Columns="1"ColumnSpacing="40px"
Orientation="FormOrientation.Vertical"
Class="mb-3 px-3">
<FormValidation>
<FluentValidationValidatorValidator="@Validator">
</FluentValidationValidator>
<TelerikValidationSummary/>
</FormValidation>
<FormItems>
<FormItem Field="@nameof(Vehicle.MotorCarrierIdentificationNumber)"
LabelText="Carrier: "
Enabled="FarsDetailSate.HasEditPermission" Class="col-sm-12 col-md-6 col-lg-4">
</FormItem>
</FormItems>
<FormButtons></FormButtons>
</TelerikForm>
Hi Luis,
Thank you for sharing the details of the error you're encountering.
To delve deeper into the issue, I attempted to replicate the problem by configuring an example with the same Form configuration. On my end, it appears that the Form operates without any errors, and the validation works as expected. I've prepared a sample for your reference, which you can access via this REPL link. Feel free to compare it with your actual application.
Should the problem persist, please modify the provided REPL sample to showcase the specific issue in a self-contained, runnable manner. This will help a more comprehensive investigation on my part, allowing me to observe the error directly.
I eagerly await hearing an update from you.
Kind Regards,
Hristian
Hi Hristian,
Sorry I didn't add all the details, in this case the MotorCarrierIdentificationNumber can be nullable string, since sometime is added, the issue is using the FormItem as a string.
Can you test it again using string instead of an int ?
Regards,
Luis
Hi Hristian,
I was able to replicate my issue, see the FormItem Address.City, I got the error, of course if I do the Template it works fine but it is not binding correctly since it is taking only the first letter of the string I'm typing on the Textbox.
See below the code to reproduce, I even use the REPL and got the same error