Hey Telerik-Team,
unfortunatelly we're not able to set the button text for the file input. The <span> is empty and the component does not allow setting the caption:
Code:
HTML:
Output:
No ChildComponent seems to be allowed - when I manually modify the html and put something in the empty <span>, the text appears:
Hi Marin,
with that information, I figured out, that we had indeed a missing localization string ("FileSelect_SelectFiles"). It now has a proper value :)
Nevertheless it would be great to add a parameter to the TelerikFileSelect with a custom caption.
The changes would be fairly simple on your side:
TelerikFileSelect.cs:
Add (around line 40):
[Parameter] public string? SelectTitle {get;set;}
Change line 238:
__builder.AddAttribute(12, "Text", RuntimeHelpers.TypeCheck<string>(BaseComponent.Localizer["FileSelect_SelectFiles"]));
to:
__builder.AddAttribute(12, "Text", SelectTitle ?? RuntimeHelpers.TypeCheck<string>(BaseComponent.Localizer["FileSelect_SelectFiles"]));
2 lines of code and everyone using the FileSelect can change the caption to "Click here to upload avatar" or "Click here to upload backup", ... you name it. A nice improvement :)
Regards
Hello Benjamin,
Pease post a simple runnable reproducible in REPL so we can take a look. At the moment it looks like a localization string might be missing from the app's localization implementation.
Regards,
Marin Bratanov
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.