Open SvdSinner opened 2 weeks ago
Hi @SvdSinner,
I tested with this and it seems to work just fine:
<RadzenTemplateForm Data="@model">
<RadzenUpload @ref=upload Auto="false" Url="upload/single" />
<RadzenButton Text="Upload" Click="@(() => upload.Upload())" />
</RadzenTemplateForm>
@code {
RadzenUpload upload;
class Model
{
}
Model model = new Model();
}
Please provide a complete snippet which reproduces the problem.
Describe the bug If a RadzenUpload control with its Auto property set to false is placed inside of a RadzenTemplateForm control, the file cannot be uploaded manually.
To Reproduce Steps to reproduce the behavior:
Futher details here: https://forum.radzen.com/t/error-uploading-the-file/18772
Expected behavior After file selection, the RadzenUpload control should have a non-null value for the file (uploadDD.HasValue should be true) This should happen regardless of whether it is inside a RadzenTemplateForm or not. (NOTE: In the documentation, the RadzenUpload is listed under the "Forms" category, so it connotates that it should work inside a form)
Additional context It is trivial to rearrange the .razor file to move the RadzenUpload outside of the RadzenTemplateForm, repeat the above reproduction and see that the RadzenUpload will then work as expected. Changing the Auto property to true will also prevent the issue, although that prevent any code from running before the upload happens.