Function ImageUpload(uploadedImages As BO.Models.UploadedImage) As ContentResult If uploadedImages.Image.Last.ContentType.StartsWith("image/", StringComparison.OrdinalIgnoreCase) Then Dim imageBytes As Byte() = BO.Factory.Image.ResizeImage(194, 194, uploadedImages.Image.Last.InputStream, Drawing.Brushes.White, Drawing.Imaging.ImageFormat.Png) Dim thumbBytes As Byte() = BO.Factory.Image.ResizeImage(100, 100, uploadedImages.Image.Last.InputStream, Drawing.Brushes.White, Drawing.Imaging.ImageFormat.Png) BO.Factory.ContractorFactory.SaveImages(imageBytes, thumbBytes, uploadedImages.ContractorId) End If Return Content(String.Empty)End FunctionFunction ImageRemove(uploadedImages As BO.Models.UploadedImage) As ContentResult Return Content(String.Empty)End Function <img alt="@Model.Name" data-upload-image="true" src="@Url.Action("image", New With {.controller = "contractor", .area = "contractor", .id = Model.ContractorId})" /> @code Dim imageUploada As Kendo.Mvc.UI.Upload = Html.Kendo.Upload().Name("Image") _ .Multiple(False) _ .Async(Function(y) y.AutoUpload(True) _ .Save("imageupload", "contractor", New With {.area = "contractor", .contractorid = Model.ContractorId}) _ .Remove("imageremove", "contractor", New With {.area = "contractor", .contractorid = Model.ContractorId})) _ .Events(Function(events) events.Success("imageUploaded").Error("onUploadError")) imageUploada.Render() End Code</div><script> function onUploadError(e) { alert(e.operation) alert(e) alert(getFileInfo(e)) } function imageUploaded(e) { $("img[data-upload-image]").each(function (index) { var url = $(this).attr("src") + '?' + Math.random() * 1000000; $(this).attr("src", url); }); } function getFileInfo(e) { return $.map(e.files, function (file) { var info = file.name; // File size is not available in all browsers if (file.size > 0) { info += " (" + Math.ceil(file.size / 1024) + " KB)"; } return info; }).join(", "); }</script> @(Html.Kendo().Grid<ElementViewModel>().Name("gridEle").Columns(cols =>{ cols.Bound(e => e.EleNum)}).DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("GetElements", "Rating", pi)) ).ClientDetailTemplateId("tempSubEle") )<script id="tempSubEle" type="text/kendo-tmpl">@(Html.Kendo().Grid<SubElementViewModel>().Name("gridSubEle_#=EleID#").Columns(cols =>{ cols.Bound(e => e.Rating) .ClientTemplate("<input type='checkbox' value='1' " + "#if(Rating==1){#checked='checked'#}# />" );}).DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("GetSubElementsByElementID", "Rating", new { eID = "#= EleID #" }))).ToClientTemplate()) </script>public ActionResult Index(){ var client = new UnitServiceClient(); var listOfUnitsFromService = client.GetListOfUnits(true); var model = new UnitModel { UnitTypes = listOfUnitsFromService.ToList() }; return View(model);}<div class="row-fluid"> <div class="span12"> <div class="k-block"> <div class="k-header">Unit List</div> @(Html.Kendo().Grid(Model.UnitTypes) .Name("Grid") .Columns(columns => { columns.Bound(p => p.Id).Groupable(false); columns.Bound(p => p.Name); columns.Command(command => { command.Custom("Edit Unit"); }).Width(160); }) .Groupable() .Pageable() .Sortable() .Scrollable() .Filterable() ) </div> </div>01. @(Html.Kendo().Grid(Model)02. .Name("Grid")03. .HtmlAttributes(new { style = "width:80%" })04. .Columns(columns =>05. {06. columns.Bound(p => p.CountyID);07. columns.Bound(p => p.County);08. columns.Bound(p => p.OrderNum);09. columns.Bound(p => p.ShippedDate).Format("{0:MM/dd/yyyy}");10. columns.Bound(p => p.InvCode);11. columns.Bound(p => p.TagName);12. columns.Bound(p => p.Quantity)13. .ClientGroupFooterTemplate("Total: #=sum#");14. })15. .Groupable()16. .Pageable()17. .Sortable()18. .Filterable()19. .DataSource(dataSource => dataSource20. .Ajax()21. .Group(g => g.Add(p => p.CountyID))22. .Group(g => g.Add(p => p.County))23. .Group(g => g.Add(p => p.OrderNum))24. .Group(g => g.Add(p => p.ShippedDate))25. .Aggregates(aggregates =>26. {27. aggregates.Add(p => p.Quantity).Sum();28. })29. .Read(read => read.Action("CountyMonth_Read", "Report").Data("CountyMonthData"))30. .PageSize(10)31. 32. )33. 34.)Hello all Kendo experts. I'm facing an issue here with MVC Grid batch update. Your help will be appreciated here. So here is my scenario.
Please bear in mind, it's the same column, but rows are editable or not (given the condition). I've alredy acheived at this point.
(See screenshot attached).
What I'm looking for is.
On Save Changes event, calculate the values of the other rows.
The problem I'm facing is, since on the natch update, these rows were not "Edited" by the user, these values are not refreshes at the controller.
So, basically what I'm looking for, is for the same type of column, make some rows non-editable, but refresh with calculated values on the Save changes.
In the screeshot supplied, the rows in blue are my calculated rows.
Any help please?