Add File on client with Javascript

2 posts, 0 answers
  1. Robert Madrian
    Robert Madrian avatar
    229 posts
    Member since:
    Apr 2003

    Posted 05 Aug 2016 Link to this post


    I use the upload Control in a editor template in my telerik mvc grid - as you can see in the attached Picture. Upload works but I also want to

    have an initial file if it is saved in the DB - so that I can use upload remove to delete it - but I have to set the file in the onEdit Event on client of the grid but this does'nt work (see Code)

    • is it not possible to use MVC Upload Control and set a file(s) in Javascript?
    function onEdit(e) {
            var files = [
                { name: "file1.doc", size: 525, extension: ".doc" },
                { name: "file2.jpg", size: 600, extension: ".jpg" },
                { name: "file3.xls", size: 720, extension: ".xls" },
                files: files


  2. Dimiter Madjarov
    Dimiter Madjarov avatar
    2312 posts

    Posted 08 Aug 2016 Link to this post

    Hello Robert Madrian,

    Setting the initially selected files is only possible when the widget is initialized, as in the current case. If the widget should be initialized in the edit event handler, I would recommend to stick to the JavaScript version of the Upload.

    Dimiter Madjarov
    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Back to Top