I would like to have my users click my own button or element to trigger the file select dialog that you get from clicking the "Select Files..." button on the Upload component.
A workaround is to use a function like this
window.customUploadClick = function () {
$('.k-upload-button input').trigger('click');
}
---
ADMIN EDIT
Completed with 3.0.0 release
If you are not using jQuery already, you don't have to add it for this, standard browser API can do this too:
@inject IJSRuntime _js
<script suppress-error="BL9992">
window.customUploadClick = function () {
document.querySelector(".k-upload-button input").click();
}
</script>
<TelerikButton OnClick="@InvokeSelectClick">invoke click</TelerikButton>
<TelerikUpload></TelerikUpload>
@code{
async Task InvokeSelectClick()
{
await _js.InvokeVoidAsync("customUploadClick");
}
}
---