Hi,
I am using http://demos.telerik.com/aspnet-mvc/upload/chunkupload to upload video file around 2 GB using chunk of 10 MB, all setting in config has been done.
It worked on Firefox, Chrome and IE with no issue, great tool.
But when I tried to upload using safari on windows 10 OS, the same code do not worked and it seems it is in infinite loop and file size keeps increasing...
Config setting is as below:
<httpRuntime targetFramework="4.5" maxRequestLength="2147483647"/>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647"/>
</requestFiltering>
</security>
.cshtml:
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("ChunkSave", "Upload")
.Remove("Remove", "Upload")
.AutoUpload(true)
.ChunkSize(20000000) // Will separate the file into chunks of size 1100 bytes.
.Concurrent(true) // Will upload all files simultaneously.
.AutoRetryAfter(300) // Will attempt a failed chunk upload after 300ms.
.MaxAutoRetries(4) // Will attempt the same failed chunk upload 4 times.
)
)
C# code:
public void AppendToFile(string fullPath, Stream content)
{
try
{
using (FileStream stream = new FileStream(fullPath, FileMode.Append, FileAccess.Write, FileShare.ReadWrite))
{
using (content)
{
content.CopyTo(stream);
}
}
}
catch (IOException ex)
{
throw ex;
}
}
public ActionResult ChunkSave(IEnumerable<HttpPostedFileBase> files, string metaData)
{
if (metaData == null)
{
return Save(files);
}
MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(metaData));
var serializer = new DataContractJsonSerializer(typeof(ChunkMetaData));
ChunkMetaData chunkData = serializer.ReadObject(ms) as ChunkMetaData;
string path = String.Empty;
// The Name of the Upload component is "files"
if (files != null)
{
foreach (var file in files)
{
path = Path.Combine(Server.MapPath("~/App_Data"), chunkData.FileName);
AppendToFile(path, file.InputStream);
}
}
FileResult fileBlob = new FileResult();
fileBlob.uploaded = chunkData.TotalChunks - 1 <= chunkData.ChunkIndex;
fileBlob.fileUid = chunkData.UploadUid;
return Json(fileBlob);
}
public ActionResult Save(IEnumerable<HttpPostedFileBase> attachments)
{
//The Name of the Upload component is "attachments".
foreach (var file in attachments)
{
//Some browsers send file names with a full path. You only care about the file name.
var fileName = Path.GetFileName(file.FileName);
var destinationPath = Path.Combine(Server.MapPath("~/App_Data"), fileName);
file.SaveAs(destinationPath);
}
//Return an empty string to signify success.
return Content("");
}
Can any one help me if I did something wrong?

Hi
I have a kendo template that uses resources and one of the german resorces has an umlaut. The template is loaded using kendo.template and kendo.render.
I found a link that complains about this http://www.telerik.com/forums/german-umlauts-not-working-in-listview%27s-client-template-when-coming-from-resources but the solution from there does not work: Html.Raw
I have tried also
@Html.Raw(HttpUtility.HtmlEncode(Resources.GridSaveChanges).Replace("#", "\\#"))
but it does not work.
I currently have a dropdown list with Virtualization which shows the dropdowns as follows "First Middle Last (XXX-XX-XXXX)". When typing in the seach box I can successfully search based on name or SSN with dashes. However I would like to be able to search on SSN without dashes. I tried attaching another property to the viewmodel sent from the lookup controller but am unable to figure out how to achieve what I want while still preserving the dashes in the UI. My thought was to catch the filter and apply regex on it serverside that if only number had been entered then to add dashes after 3rd and 5th character which would allow me get my desired output.
Here is the View:
01.@Html.LabelFor(model => model.VisitorID)02. @(Html.Kendo().DropDownList()03. .Name("VisitorID")04. .DataTextField("Value")05. .DataValueField("ID")06. .MinLength(2)07. .HtmlAttributes(new { style = "width:100%" })08. .Height(290)09. .Filter(FilterType.Contains)10. .DataSource(source =>11. {12. source.Custom()13. .ServerFiltering(true)14. .ServerPaging(true)15. .PageSize(80)16. .Type("aspnetmvc-ajax") //Set this type if you want to use DataSourceRequest and ToDataSourceResult instances17. .Transport(transport =>18. {19. transport.Read("Virtualization_GetVisitor", "Lookups");20. })21. .Schema(schema =>22. {23. schema.Data("Data") //define the [data](http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.data) option24. .Total("Total"); //define the [total](http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.total) option25. });26. })27. .Virtual(v => v.ItemHeight(26).ValueMapper("VisitorLookups"))28. .NoDataTemplate("<a onclick=\"addNewEntityPartial(\'Visitor\');\">Add a new Visitor</a>")29. )30. @Html.ValidationMessageFor(model => model.VisitorID)
The C# For virtualization:
01.#region VisitorLookup02. public ActionResult Virtualization_GetVisitor([DataSourceRequest] DataSourceRequest request)03. {04. return Json(GetVisitor().ToDataSourceResult(request));05. }06. public ActionResult Visitor(int[] values)07. {08. var indices = new List<int>();09. 10. if (values != null && values.Any())11. {12. var index = 0;13. 14. foreach (var visitor in GetVisitor())15. {16. if (values.Contains(visitor.ID))17. {18. indices.Add(index);19. }20. 21. index += 1;22. }23. }24. return Json(indices, JsonRequestBehavior.AllowGet);25. }26. 27. private IQueryable<LookupViewModel> GetVisitor()28. {29. var ro = User.IsInRole("ReadOnly");30. return db.Visitors.Select(visitor => new LookupViewModel31. {32. ID = visitor.ID,33. Value = (visitor.Flag == true ? "FLAGGED " : "") +34. visitor.FirstName + " " +35. visitor.MiddleName + " " +36. visitor.LastName +37. " (" + (ro ? "XXX-XX-XXXX" : visitor.SSN.Replace("-", "")) + ") " +38. (visitor.Flag == true ? "FLAGGED" : ""),39. SSN = (ro ? "XXX-XX-XXXX" : visitor.SSN.Replace("-", ""))40. });41. }42. #endregion
I feel like I'm very close but am not quite sure how to modify the filter in the request on line 4 (second snippet) to achieve what i want.
Below was the path I was on:
01.public ActionResult Virtualization_GetVisitor([DataSourceRequest] DataSourceRequest request)02. {03. Regex regex = new Regex(@"[\d]");04. foreach (var filter in request.Filters)05. {06. if (regex.IsMatch(((FilterDescriptor)filter).ConvertedValue.ToString()))07. {08. 09. if (((FilterDescriptor)filter).Value.ToString().Length > 2)10. {11. ((FilterDescriptor)filter).Value.Insert(2, "-");12. }13. if (((FilterDescriptor)filter).Value.ToString().Length > 4)14. {15. ((FilterDescriptor)filter).Value.Insert(4, "-");16. }17. }18. }19. return Json(GetVisitor().ToDataSourceResult(request));20. }But that does not compile since Insert can't be made on a Object.
Any help?
Hi guy's,
I've been doing my best to find a solution on the forum and google but can't find what I'm looking for.
I have a grid which uses a toolBar template for the "add" button.
@(Html.Kendo().Grid(Model.WorkingDays) .Name("WorkEffortRecordsGrid") .DataSource(ds => ds.Ajax() .Read(read => read.Action("GetWorkingDay", "WorkRecordEffort").Data("getTimezoneOffset")) .Create(create => create.Action("SaveWorkRecordEffort", "WorkRecordEffort").Data("getTimezoneOffset")) .Update(update => update.Action("UpdateWorkRecordEffort", "WorkRecordEffort").Data("getTimezoneOffset")) .Group(groups => groups.Add(p => p.Activity.Name)) .Model(model => model.Id(viewModel => viewModel.Id)) ) .Columns(columns => { columns.Bound(viewmodel => viewmodel.WorkRecord.Name).Title(Strings.WorkRecordId).ClientTemplate("#= (typeof WorkRecord === 'undefined')? '' : WorkRecord == null ? '' : WorkRecord.Name #"); columns.Bound(viewmodel => viewmodel.Summary); columns.Bound(viewModel => viewModel.Task.Name).Title(Strings.TimeTaskName).ClientTemplate("#= (typeof Task === 'undefined')? '' : Task == null ? '' : Task.Name #"); columns.Bound(viewModel => viewModel.StartTime).ClientTemplate("#= StartTime == null ? '' : kendo.toString(StartTime, \"t\") #"); columns.Bound(viewModel => viewModel.EndTime).ClientTemplate("#= EndTime == null ? '' : kendo.toString(EndTime, \"t\") #"); columns.Bound(viewModel => viewModel.Duration); columns.Command(commands => { commands.Edit().UpdateText(Strings.Save); }); }) .AutoBind(true) .ToolBar(toolBar => { //toolBar.Create().Text("default add").HtmlAttributes(new { onclick = "Ps.onCreate()" }); toolBar.Template("<a class='k-button k-button-icontext' onclick='Ps.onCreate()' href='#'></span>Create</a>"); }) .Editable(editable => editable.Mode(GridEditMode.PopUp).Window(w => w.Width(610)).TemplateName("WorkRecordEffortEditor")) .Filterable() .Events(events => events.Edit("Ps.onEdit").DataBound("Ps.onDataBound")))
with a javascript function which has to do some business logic through ajax calls
/*** When Add is clicked*/export function onCreate() { // clear the error message if it exists $('#errorMessages').html(""); // do ajax call to the server to check if all existing records have end times $.ajax({ type: 'POST', url: Urls.checkEndTimes, dataType: "JSON", success: allHaveEndTimes => { // if all records have end times if (allHaveEndTimes) { // show the editor box alert("here - true - show the editor box"); } else { // show the error message $.ajax({ type: 'POST', url: Urls.showErrorMessage, contentType: 'application/json', dataType: "html", success: response => { $('#errorMessages').html(response); } }); } }, error: function () { alert("somethings gone wrong... this is not good..."); } });}
I haven't figured out how to make the editor display when the response comes back as true ("allHaveEndTimes")
Anybody have any ideas?
Thanks
Tom
Hi there,
I’ve a grid with a column that is using a DropDownList as
the template. It works as expected but I need to change the width of the
dropDownList’s list.
How can I do that?
Here's the grid's code
01.@(Html.Kendo().Grid(Model)02. .Name("grid")03. .Columns(columns =>04. {05. columns.Command(command =>06. {07. command.Destroy().Text("Eliminar");08. }).Width(100).Title("Comandos");09. columns.Bound(c => c.Empleado)10. .ClientTemplate("#=Empleado.NumeroExpediente# - #=Empleado.Nombre#"11. + " #=Empleado.Apellido1# #=Empleado.Apellido2#")12. .Title("Empleado")13. .Width(190);14. })15. .Editable(x => x.Mode(GridEditMode.InCell))16. .DataSource(dataSource => dataSource17. .Ajax()18. .ServerOperation(false)19. .Batch(true)20. .Destroy("DeleteSubContrato", "Crear")21. .Model(model =>22. {23. model.Id(p => p.ID);24. model.Field(p => p.ID).DefaultValue(0);25. model.Field(p => p.Empleado).DefaultValue(26. ViewData["defaultEmpleado"] as Personal);27. })28. )29. .Scrollable(x => x.Height(300))30.)
and here's the DropDownList template
1.@(Html.Kendo().DropDownListFor(m => m)2. .DataValueField("ID")3. .DataTextField("NumeroExpediente")4. .ValueTemplate("<span> #:data.NumeroExpediente# - #:data.Nombre# #:data.Apellido1# #:data.Apellido2#</span>")5. .Template("<span> #:data.NumeroExpediente# - #:data.Nombre# #:data.Apellido1# #:data.Apellido2#</span>")6. .BindTo((System.Collections.IEnumerable)ViewData["empleados"])7. .Filter(FilterType.StartsWith)8.)
Here's a screenshot with the dropdownlist
https://www.dropbox.com/s/wddlfekt28ss8zg/dropDownList.png?dl=0
Thank you.

We want to add a new item locally to a virtual DropDownList.
@(Html.Kendo().DropDownListFor(model => model.SiSpaceDetailId) .DataTextField("SiSpaceId") .DataValueField("Id").Filter("contains") .Events(e => e.Change("onSiSpaceSelect").DataBound("onDatabound")) .DataSource(dataSource => dataSource.Custom() .ServerFiltering(true) .ServerPaging(true) .PageSize(80) .Type("aspnetmvc-ajax") .Transport(tr => tr.Read(read => read.Action("GetSiSpaceIds", "Controller") ))) .Virtual(v => v.ItemHeight(26).ValueMapper("valueMapper")) .HtmlAttributes(new { Id = "siSpaceId", IsSingleSelection = true }) .Template("<span>#: data.SiSpaceId #</span> <a style=\"float: right\" href='javascript:deleteSiSpaceDialog(\"#: data.Id #\")'> Delete </a>") )The add is all standard:
<script id="noDataTemplate" type="text/x-kendo-tmpl"> <div id="addNew" style="padding: 10px;"> <div> Add - '#: data.filterInput.val() #' ? </div> <br /> <button class="k-primary" onclick="addNew('#: data.element[0].id #', '#: data.filterInput.val() #')">Add</button> </div></script>And the JS looks like this:
onDatabound: function() { var data = $("#siSpaceId").data("kendoDropDownList"); data.listView.content.find("#addNew").remove(); if (data.dataSource.view().length === 0) { var template = kendo.template($("#noDataTemplate").html()); data.listView.content.append(template(data)); $("#addNew").parent().css("height", "auto"); //height is set to 0 for some reason, this is a workaround }},addNew: function(widgetId, value) { var widget = $("#" + widgetId).getKendoDropDownList(); var dataSource = widget.dataSource; if (confirm(alert.areYouSure)) { dataSource.add({ Id: emptyGuid, SiSpaceId: value }); dataSource.one("sync", function() { widget.select(dataSource.view().length - 1); }); dataSource.sync(); }}
If the Id is an empty Guid, we are adding it on submit. Since adding the virtualization for better performance the add stopped working.
Can you post any working example?

Is there any way to determine if a dropdown is enabled or not?
I've tried:
var dropDown = $("#selectionList).data("kendoDropDownList");
if (dropDown.attr("aria-disabled"))
if (dropDown.prop("disabled")
if (dropDown.is(":disabled"))
nothing is supported.
thank you.

I have a tabstrip that contains several tabs, each of which contains a grid. When the page loads and I go to the Messages tab, the grid displays the data correctly. But there is no scrollbar, even though there are many pages of data (see Initial.png).
Once I click on any page number, the scrollbar appears (see AfterPaging.png). After that, it works just fine. But I cannot get the scrollbar to appear at the beginning.
My tab strip looks like this:
<div id="TabsContainer"> <div class="k-content" style="margin-top: 10px;"> @( Html.Kendo().TabStrip() .Name("Tabstrip") .Animation(animation => animation.Enable(false)) .HtmlAttributes(new { @class = "TabStripContents MinerTabStripContents" }) .Items(tabstrip => { tabstrip.Add().Text("Accounts (0)") .LinkHtmlAttributes(new { id = "SummaryTab" }) .Content(@Html.Partial("_SummaryTable").ToHtmlString()) .Selected(true); tabstrip.Add().Text("Errors (0)") .LinkHtmlAttributes(new { id = "ErrorsTab" }) .Content(@Html.Partial("_ErrorsTable").ToHtmlString()); tabstrip.Add().Text("Parameters (0)") .LinkHtmlAttributes(new { id = "ParametersTab" }) .Content(@Html.Partial("_ParametersTable").ToHtmlString()); tabstrip.Add().Text("Messages (0)") .LinkHtmlAttributes(new { id = "MessagesTab" }) .Content(@Html.Partial("_MessagesTable").ToHtmlString()); tabstrip.Add().Text("Logs (0)") .LinkHtmlAttributes(new { id = "LogsTab" }) .Content(@Html.Partial("_LogsTable").ToHtmlString()); }) ) </div></div>
The Messages tab strip is this:
@( Html.Kendo().Grid<MinerDatabase.GetMinerProcessMessages_Result>() .TableHtmlAttributes(new { @class = "grid-with-padding", style = "width: 100%; border: solid 1px gray;" }) .Name("MessagesGrid") .Columns(columns => { columns.Bound(a => a.MessageDate).Width(150).Title("Date").Format("{0:MM/dd/yyyy hh:mm tt}"); columns.Bound(a => a.AccountID).Width(100).Title("Account ID"); columns.Bound(a => a.Step).Width(300); columns.Bound(a => a.ResultMessage).Width(300).Title("Text"); }) .Sortable() .Pageable() .Scrollable(scroll => scroll.Virtual(true)) .DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("ReadMessages", "Miner").Data("GetMinerProcessDataAndSendAntiForgery")) .PageSize(20) ) .Events(ev => ev.DataBound("OnMessagesDataBound")) .HtmlAttributes(new { @class = "TabContents MinerTabContents" }) .NoRecords("There are no messages for this miner process"))
The OnMessageDataBound function is empty, but the problem still happens.
I set the height of the MessagesGrid in $(document).ready(), but the problem happens even if I comment that out.
Any ideas on what I can do to make the scroll bar appear?
Thanks.

I need to sort the values in a multiple select filter. I found the following http://dojo.telerik.com/IsOTA
But it is not working for me. I only need to sort one filter. It fails on the container.empty() line because filterMultiCheck is null. I can NOT understand why it is null. I've inspected the objects in the DOM and everything seems to be there.
ProjectRequests.filterMenuInit = function (e) {
if (e.field === "Position") { var filterMultiCheck = this.thead.find("[data-field=" + e.field + "]").data("kendoFilterMultiCheck"); filterMultiCheck.container.empty(); filterMultiCheck.checkSource.sort({field: e.field, dir: "asc"});filterMultiCheck.checkSource.data(filterMultiCheck.checkSource.view().toJSON());filterMultiCheck.createCheckBoxes(); }
My code is slightly different from the example. The grid is created on a cshtml page and the FilterMenuInit is call as so:
.Events(events => events.FilterMenuInit("ProjectRequests.filterMenuInit"))
The page is rendered before the FilterMenuInit is called so I just don't get it.
Any help is appreciated.

This is probably an easy answer but even after searching through documentation i haven't figured it out yet. I have a column in a Kendo Grid that i would like to convert from an integer to a string for filtering purposes. Basically on my ID column, if the user types in 3 it will filter the records for 3, 13, 23 33, ect. Right now what it does in the filter after i type in 3 and hit enter, it converts it to 33.00 Below is the Column
columns.Bound(c => c.ID).Title("Ticket No.")
.ClientTemplate(@Html.ActionLink("#=ID#", "View", new { ID = "#=ID#" }).ToHtmlString())
.Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
// Something here like .ToString()
