I'm using the Kendo for ASP.Net MVC Upload control. I'm on version 2019, and upgrading right now is not an option unfortunately. When the user chooses a file (multi-select is off), I have a Submit button separate from the control that the user clicks to begin the upload. While the upload is taking place, I want the Choose File button to be disabled. I need the pause and cancel buttons enabled, so it won't work to disable the entire control. I have a place to put some javascript to disable the button, but everything I've tried so far doesn't accomplish disabling the button.
Here is the declaration of the control:
Hi,
I have have a requirement, where I need to upload an excel file. After uploading the excel file when the user clicks Import button then all the excel data should add to the Kendo grid.
I am using .Net 8 with MVC Razor page to achieve this. Is there any library I have to use to read the excel data to kendo grid or the kendo grid
have some API(s) which can read the excel file and update the grid.
This is my excel records.
This is my application, when the user upload this above excel and click on import from Excel, then the above excel records should fill in the
kendo grid.
Hi
My req is to save the documents in database in blob format. When user submits the form, the form will be saved in database and then with saved formid as reference key uploaded documents will be saved in documents table.
When user edits submitted form, I need to display already attached forms on the page. User may delete or attach new forms in edit screen.
When user viewing the form in read only mode, user should be able to download the form. How can i achieve this?
below code is working for uploading...
<div class="row col-md-12">
<div class="col-md-10">
<div class="form-group">
@Html.LabelFor(model => model.files, htmlAttributes: new { @class = "control-label col-md-4" })
<div class="col-md-8">
@(Html.Kendo().Upload()
.Name("files")
.Validation(validation => validation
.AllowedExtensions(new string[] { ".pdf", ".txt", ".xlsx", ".xls", ".doc", ".docx" })
.MaxFileSize(15728640)
.MinFileSize(3000))
.ShowFileList(true)
.HtmlAttributes(new { aria_label = "files" })
)
@Html.ValidationMessageFor(model => model.files, "", new { @class = "text-danger" })
</div>
</div>
</div>
</div>
viewmodel class
[Display(Name = "Upload relevant documents")]
public IEnumerable<HttpPostedFileBase> files { get; set; }
foreach (var file in vm.files)
{
byte[] document = new byte[file.ContentLength];
file.InputStream.Read(document, 0, file.ContentLength);
RLADOCUMENT rd = new RLADOCUMENT
{
RLAFORMID = (int)entity.ID,
DOCUMENTNAME = file.FileName,
CONTENTTYPE = file.ContentType,
DOCUMENTSIZE = document.Length,
DOCUMENTDATA = document,
CREATEDBY = Environment.UserName,
CREATEDDATE = DateTime.Now,
EXTENSION = Path.GetExtension(file.FileName)
};
_context.RLADOCUMENTS.Add(rd);
_context.SaveChanges();
}
Can someone help me how to display already attached files in Edit Mode with remove and upload option and download the attached reports.
How to display the "File(s) saved successfully in the Custom Kendo Upload Template.
Using the template below:
<span class='k-progress'></span>I'm using Kendo v 2023.2.606 from the Kendo CDN.
In my view I have the following code:
<div class="row row-cols-lg-auto gx-3 gy-2 align-items-baseline mt-2">
<div class="col">
<h4>Choose File</h4>
<!-- upload a file -->
@(Html.Kendo().Upload()
.Name("files")
.Multiple(false)
.ShowFileList(false)
.Async(_ => _
.Save("SubmitFile", "DataImport", new { Area = "Admin" })
.Batch(true)
.AutoUpload(true)
)
.Events(_ => _
.Upload("onUpload")
.Success("onUploadSuccess")
.Error("onUploadFail")
)
.Validation(_ => _
.AllowedExtensions(new string[] { "xls", "xlsx", "csv" })
.MaxFileSize(3145728)
)
)
</div>
</div>
If I select a file with an extension that is not listed, e.g. .zip, or I select a file that is more than 3.14MB all I see is this:
It does not hit my MVC controller action (which is fine) but the only indication of a problem is the (!) icon. The icon is not clickable.
Why is it not displaying a message saying the file is not valid/too big?
Has anyone else noticed that neither the .Net core or MVC upload module works when run under iOS? https://www.telerik.com/aspnet-core-ui/upload
If you try and upload anything you can never click submit.
You can try it on the demo here on any iOS device -
This seems to have broken when the move was made to go to Sass from Less a few months ago. It worked fine in Less. With it being such a major component it is something that you would hope gets fixed very quickly.
I have a form as follows where it fires validation for text box controls but not for file upload
<form id="frmItem">
<table class="table table-bordered">
<thead class="bg-dark text-center text-white">
<tr>
<th colspan="2">Add/Modify Item</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width:404px;">Item ID Name</td>
<td>
@(Html.Kendo().TextBox().Name("txtItemName")
.HtmlAttributes(new { placeholder = "Item ID Name", required = "required", validationmessage = "Enter Item ID Name" }))
</td>
</tr>
<tr>
<td>UN Number</td>
<td>
@(Html.Kendo().TextBox().Name("txtUnNumber")
.HtmlAttributes(new { placeholder = "UN Number", required = "required", validationmessage = "Enter UN Number" }))
</td>
</tr>
<tr>
<td>Packing Instructions</td>
<td>
@(Html.Kendo().TextBox().Name("txtPackingInstructions")
.HtmlAttributes(new { placeholder = "Packing Instructions", required = "required", validationmessage = "Enter Packing Instructions" }))
</td>
</tr>
<tr>
<td>SDS Sheet</td>
<td>
@(Html.Kendo().Upload().Name("SdsSheet")
.Multiple(false)
.HtmlAttributes(new { required = "required" }))
</td>
</tr>
<tr>
<td>Cargo Only?</td>
<td>@(Html.Kendo().CheckBox().Name("txtCargoOnly"))</td>
</tr>
<tr>
<td>Example Shipment Ground (Fully Regulated)</td>
<td>@(Html.Kendo().Upload().Name("GroundShipment"))</td>
</tr>
<tr>
<td>Example Shipment Next Day Air (Fully Regulated)</td>
<td>@(Html.Kendo().Upload().Name("NextDayShipment"))</td>
</tr>
<tr>
<td>Example Shipment Freight (Fully Regulated)</td>
<td>@(Html.Kendo().Upload().Name("FreightShipment"))</td>
</tr>
<tr>
<td>Example Shipment Ground (Limited Quantity)</td>
<td>@(Html.Kendo().Upload().Name("GroundShipmentLimited"))</td>
</tr>
<tr>
<td>Example Shipment Next Day Air (Limited Quantity)</td>
<td>@(Html.Kendo().Upload().Name("NextDayShipmentLimited"))</td>
</tr>
<tr>
<td>Example Shipment Freight (Limited Quantity)</td>
<td>@(Html.Kendo().Upload().Name("FreightShipmentLimited"))</td>
</tr>
<tr>
<td colspan="2">
<button class="k-button k-button-solid-primary k-button-solid k-button-md k-rounded-md" type="submit">Submit</button>
</td>
</tr>
</tbody>
</table>
</form>
<script>
$(document).ready(function () {
var validator = $("#frmItem").kendoValidator().data("kendoValidator");
$("#frmItem").submit(function (event) {
event.preventDefault();
if (validator.validate()) {
} else {
}
});
});
</script>
Good day,
i Just updated kendo ui mvc project to the latest version currently out yesterday. now its broken.
before upgrade
after upgrade