Hi,
I want to display the existing files based on the value of the HttpPostedFileBase properties in my view model. How can I achieve this without using asynchronous uploading?
I tried what is written in this blog but whenever I save the form, the value of the files are lost.
Form:
@(Html.Kendo().Upload()
.Name("LogoImage")
.Multiple(false)
.Messages(m => m.Select("Upload"))
.Validation(validation => validation
.AllowedExtensions(new string[] { ".gif", ".jpg", ".png" })
.MaxFileSize(2097152)
)
)
View model:
public HttpPostedFileBase LogoImage { get; set; }

Hey everyone,
I'm trying to create a small grid for "articles" which is grouped by "articleGroup".
Now the plan is to change the ClientGroupHeaderTemplate, to add a checkbox to check all sub elements, for the group without showing it as a column in the grid.
I can set the grouping in the dataSource, but I struggle to add the checkbox to the group header without adding it as a column.
Html.Kendo().Grid<ArticleViewModel>() .Name("articleGrid") .Columns(c => { c.Select().Width(50); c.Bound(x => x.ArticleNo); }) .DataSource(dataSource => dataSource .Ajax() .PageSize(50) .GroupPaging(true) .Group(x => x.Add(y => y.ArticleGroup)) .Read("GridRead_Whitelist", "Plot"))
Best regards
Nils
I have a master / detail grid with a custom add new button in the child inline record that popups up a partial view. I'm trying to understand why the add new child record doesn't appear on the UI.
Any help would be greatly appreciated.
-----
@{
ViewData["Title"] = "Vendor";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="mt-3">
<h3>Vendor</h3>
@(Html.Kendo().Grid<I2MS.Models.VendorViewModel>()
.Name("gridVendor")
.Columns(columns =>
{
columns.Bound(e => e.VendorID).Hidden(true);
columns.Bound(e => e.VendorCode).Filterable(false).Width(40);
columns.Bound(e => e.Name).Width(70).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains").SuggestionOperator(FilterType.Contains)));
columns.Bound(e => e.Address).Filterable(false).Width(40);
columns.Bound(e => e.Address2).Filterable(false).Width(40);
columns.Bound(e => e.City).Filterable(false).Width(40);
columns.Bound(e => e.State).Filterable(false).Width(40);
columns.Bound(e => e.PostalCode).Filterable(false).Width(40);
columns.Template("<a title=\"Edit\" onclick=AddEditVendor(event);><img src='images/edit.png' alt='edit' /></a> <a role='button' title='Delete' onclick='onDeleteVendor(event)'><img src='images/delete.png' alt='delete' /></a>").Width(50);
})
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.Sortable()
.Pageable()
.Scrollable()
.ClientDetailTemplateId("template")
.HtmlAttributes(new { style = "height:600px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(6)
.Read(read => read.Action("HierarchyBinding_Vendor", "Vendor"))
.Model(model => { model.Id(i => i.VendorID); })
)
.Events(events => events.DataBound("dataBound"))
.ToolBar(toolbar =>
{
toolbar.Custom().Name("<span class='k-icon k-i-add'></span>Add New Vendor").HtmlAttributes(new { style = "float:right", id = "btnAddNewVendor", onclick = "AddEditVendor()" });
})
)
@(Html.Kendo().Window().Name("dlgAddEditVendor").Visible(false).Modal(true).Draggable(true))
@(Html.Kendo().Window().Name("dlgAddEditVendorContact").Visible(false).Modal(true).Draggable(true))
<script id="template" type="text/kendo-tmpl">
@(Html.Kendo().Grid<I2MS.Models.VendorContactViewModel>()
.Name("grid_#=VendorID#")
.Columns(columns =>
{
columns.Bound(o => o.VendorContactID).Hidden();
columns.Bound(o => o.FirstName).Width(40);
columns.Bound(o => o.LastName).Width(40);
columns.Bound(o => o.Phone).Width(40);
columns.Bound(o => o.Email).Width(40);
columns.Bound(o => o.Address).Width(40);
//columns.Bound(o => o.Address2).Width(200);
columns.Bound(e => e.City).Width(40);
columns.Bound(e => e.State).Width(40);
columns.Bound(e => e.PostalCode).Width(40);
columns.Template("<a title=\"Edit\" onclick=AddEditVendorContact(event,#=VendorID#);><img src='images/edit.png' alt='edit' /></a> <a role='button' title='Delete' onclick='onDeleteVendorContact(event,#=VendorID#)'><img src='images/delete.png' alt='delete' /></a>").Width(40);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Read(read => read.Action("HierarchyBinding_VendorContacts", "VendorContact", new { vendorID = "#=VendorID#" }))
.Model(model => { model.Id(i => i.VendorContactID); })
)
.ToolBar(toolbar =>
{
toolbar.Custom().Name("<span class='k-icon k-i-add'></span>Add New Vendor Contact").HtmlAttributes(new { style = "float:right", id = "btnAddNewVendorContact", onclick = "AddEditVendorContact(null,#=VendorID#)" });
})
.Pageable()
.Sortable()
.ToClientTemplate()
)
</script>
</div>
<script>
var gridName = "";
function AddEditVendorContact(event, VendorID)
{
gridName = "grid_" + VendorID;
var window = $('#dlgAddEditVendorContact').data('kendoWindow');
if (event != null )
{
window.setOptions({ title: "Edit Vendor Contact" });
var dataItem = $("#" + gridName).data('kendoGrid').dataItem($(event.currentTarget).closest("tr"));
var url = "@Url.Action("AddEditVendorContact", "VendorContact")" + "?VendorContactID=" + dataItem.VendorContactID + "&VendorID=" + VendorID;
MvcCommon.Kendo.ShowPartialViewInPopupWindow({
windowName: "dlgAddEditVendorContact",
windowWidth: 660,
windowHeight: 450,
url:url
});
}
else
{
window.setOptions({ title: "Add New Vendor Contact" });
var url = "@Url.Action("AddEditVendorContact", "VendorContact")" + "?VendorContactID=" + "&VendorID=" + VendorID;
MvcCommon.Kendo.ShowPartialViewInPopupWindow({
windowName: "dlgAddEditVendorContact",
windowWidth: 660,
windowHeight: 450,
url: url
});
}
}
function onDeleteVendorContact(event, VendorID)
{
if (confirm('Are you sure you want to delete this Record?'))
{
var gridName = "grid_" + VendorID;
var dataItem = JSON.stringify($("#" + gridName).data('kendoGrid').dataItem($(event.currentTarget).closest("tr")));
if (dataItem && dataItem != null)
{
$.ajax({
cache: false,
type: 'POST',
dataType: 'JSON',
contentType: 'application/json; charset=utf-8',
data: dataItem,
url: '@Url.Action("DeleteVendorContact", "VendorContact")',
success: function (result) {
if (result && result.success == true) {
$('#' + gridName).data('kendoGrid').dataSource.read();
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {},
complete: function (xhr, status) {}
});
}
}
}
function dataBound() {
this.expandRow(this.tbody.find("tr.k-master-row").first());
}
function AddEditVendor(e)
{
var window = $('#dlgAddEditVendor').data('kendoWindow');
if (e != null)
{
window.setOptions({ title: "Edit Vendor" });
var dataItem = $("#gridVendor").data('kendoGrid').dataItem($(e.currentTarget).closest("tr"));
var url = "@Url.Action("AddEditVendor", "Vendor", new { VendorID = "value" })".replace("value", dataItem.VendorID);
MvcCommon.Kendo.ShowPartialViewInPopupWindow({
windowName: "dlgAddEditVendor",
windowWidth: 660,
windowHeight: 365,
url:url
});
}
else
{
window.setOptions({ title: "Add New Vendor" });
var url = "@Url.Action("AddEditVendor", "Vendor", new { VendorID = "value" })".replace("value", "");
MvcCommon.Kendo.ShowPartialViewInPopupWindow({
windowName: "dlgAddEditVendor",
windowWidth: 660,
windowHeight: 365,
url:url
});
}
}
function onDeleteVendor(event)
{
if (confirm('Are you sure you want to this Record?'))
{
var dataItem = JSON.stringify($("#gridVendor").data('kendoGrid').dataItem($(event.currentTarget).closest("tr")));
if (dataItem && dataItem != null)
{
$.ajax({
cache: false,
type: 'POST',
dataType: 'JSON',
contentType: 'application/json; charset=utf-8',
data: dataItem,
url: '@Url.Action("DeleteVendor", "Vendor")',
success: function (result) {
if (result && result.success == true) {
$('#gridVendor').data('kendoGrid').dataSource.read();
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {},
complete: function (xhr, status) {}
});
}
}
}
</script>

Hi,
I have a project and the upgrade wizard for going to a newer version of Telerik takes forever to complete (>18 hours).
Is there a logfile to check why it takes so long?
Is it possible to upgrade a project by hand?
Maurice
Hi,
I currently have a grid with InCell editing and batch updates enabled using MVC calls.
On this grid I have 2 columns which have drop down lists as a client template which displays data depending on what values are on the row.
Due to this, I am using AJAX binding for the drop down lists and value mappers.
Everything is working fine with one smallish bug when editing the cells.
I currently have an issue where if you sometimes double click or quickly click on the drop down list cells, the selection shows up as "undefined".
The control loads if you click it, and you can select items, but as soon as you click out, the text returns to "undefined".
When you try to save the changes, the property is passed through as null.
Because I need to have dynamic data on the drop down lists, I can't return hard coded values using the ViewBags as shown on the demoes.
What I've tried doing is to see if I can create an artificial delay on the grid events (BeforeEdit, Edit, CellClosed) but this has been no use as the cell loses focus as soon as you click somewhere else.
Is there some error that's occurring in the Kendo Javascript files which can be tweaked or to add some sort of delay to allow the drop down to load?
Or is there any way to prevent the "undefined" error from binding a null object until you cancel?
If the controls can just correctly bind after you get the "undefined" error would be good as well.
Thanks

I have controls like text area ,Labelfor and Kendo grid in the same page i need to export all the details to MS word and customize html in button click ,it will be good if it's provided in javascript function or jquery function.can anyone help on this.
Thanks
Mohammed

Is there a way to hide/change the URL in a sortable column header in an ajax grid and keep the sorting ability?
The URL is referring to the Read ajax action (with the sort direction)
Page URL: http://mysite/Incident?FacilityID=123
Header URL: http://mysite/Incident/Read?FacilityID=123&IncidentGrid-sort=IncidentSummaryFacilityTypes-asc
Users are right-clicking the column header URL and opening in new tab/window which causes an error because it's calling an ajax grid read method, not a full page method.
We want to keep the sorting but if possible change the URL so if opened in a new window it just reloads the same page. Our grid is setup using the ajax datasource read.Action and works fine other than this URL being visible/available for opening in new windows.
The sorting demo has a different datasource, but works how we'd like: https://demos.telerik.com/kendo-ui/grid/sorting
The column headers automatically link to the page, not to a different action.
A secondary option is can we disable right-click on just the column headers.
Hi Telerik Family,
I have kendo upload and i'm uploading some image and video with that . I need to check image width and height of image so than i can understand image is proper or not proper.
I checked you have "e.files[0].size" value for .Select() event but that is not useful for me.
What you suggest?
Thanks
