This is a migrated thread and some comments may be shown as answers.

[Solved] Getting upload in submitChanges from grid.

1 Answer 60 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Maciel
Top achievements
Rank 1
Maciel asked on 11 Dec 2012, 10:39 AM
Hello.

This is my code for upload:

<%= this.Html.Telerik().Upload()
        .Name("file")
        .ShowFileList(false)
        .Multiple(false)
        .ClientEvents(events => events.OnSelect("onSelect"))
%>

and I have this grid:

<%= this.Html.Telerik().Grid<ModelClass>()
            .Name("Grid")
.
.
.
            .ClientEvents(events =>
            {
                events.OnSubmitChanges("onSubmitChangesGrid");
            })
            .Editable(editing => editing.Mode(GridEditMode.InCell))
            .KeyboardNavigation()
%>

When submitChanges from Grid is called I need to send another page informations. Then I did this:

function onSubmitChangesGrid(e) {
            e.values.GeneralName = $('#GeneralName').val();
            e.values.Gender = $('#Gender').data('tDropDownList').value();
            e.values.Number = $('#Number').data('tTextBox').value();
             
            e.values = $.extend(e.values);
}

Now, I need to add my Upload field together.

I've tried:

e.values.UploadField = $('#UploadField').data('tUpload').value();

e.values.UploadField = $('#UploadField').data('tUpload');

But didn't work.

Please, How can I do this?



1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 14 Dec 2012, 02:20 PM
Hi,

Sending the file as part of the SubmitChanges event is not supported. You'll need to setup async upload and associate the files with their respective records on the server.

You can see a working demo project here.

I hope this helps.

Kind regards,
Tsvetomir Tsonev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
Upload
Asked by
Maciel
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or