I'm trying to achieve what was done in this example: http://stackoverflow.com/questions/25439340/how-do-i-display-kendo-grid-inside-kendo-grid-cell
I can in fact achieve the grid within a cell using the 1st concept where I have a grid column defined like this:
columns.Template(o => "").Width(460).Title("QA").ClientTemplate("#= buildInquiryGrid(data) #");
This does work, and each item related to the main grid is displayed along with a button where I try to find the row detail of button click but nothing seems to work.
This the current attempt, but other suggestion on how to do this on standard html table works. Everything always comes back undefined. It seems to me that the HTML table is re-formatted to something else and therefore not find able through standard methods.
function addResponse(id) {
var $row = $(this).parents("tr");
var name = $(this).closest("div").find(".theQuestion").text();
alert(name);
}
Ideally, I'd like to use this:
columns.Template(o => "").Width(460).Title("QA").ClientTemplate(
(Html.Kendo().Grid<Domain.Entities.AIMS.Inquiry>()
.Name("ActionItems_#=ActionItemId#")
.Columns(c =>
{
c.Bound(e1 => e1.Question).Width(200);
c.Bound(e1 => e1.AskedBy).Width(60);
c.Bound(e1 => e1.Asked).Width(80).Format("{0:MM/dd/yyyy}");
c.Bound(e1 => e1.Response).Width(200).Title("Answer");
})
.AutoBind(true)
.DataSource(source1 => source1
.Ajax()
.PageSize(5)
.Read(read1 => read1.Action("GetInquiries", "AIMS", new { id = "#=ActionItemId#" }))
)
.ToClientTemplate()
.ToHtmlString()
));
This will display an empty grid with header row inside each row column whether I have the event called or not.
.Events(e => e.DataBound("onGridDataBound"))
function onGridDataBound(e) {
$('#ActionItems script').appendTo(document.body);
}
Adding this has no affect and I did debug and stop on the line to ensure the event was in fact being called and it was.
The GetInquiries Ajax call to the controller never gets called and I don't see any errors in the console to indicate why. The method does work as I use in the 1st approach.
For completeness here is the Controller Method,
// Approach #1 Works
public JsonResult GetInquiries( int id)
{
var model = _aimsService.GetInquiries(id);
return Json(model, JsonRequestBehavior.AllowGet);
}
// Approach #2
public ActionResult GetInquiries( [DataSourceRequest] DataSourceRequest request,int id)
{
var model = _aimsService.GetInquiries(id);
var result = model.ToDataSourceResult(request);
return Json(result);
}
Maybe the method signature is not appropriate?
I prefer to get the 2nd way working, but will use the 1st method if that can be figured out.
Best Regards,
Hi,
I've been searching on the net for some while to see if there's a way to do this. I'll try my best to formulate what I mean in an understandable way.
Take this view for instance. I was wondering if there's any way to specifiy a parameter to the Action.
What I essentially am trying to do is this; I have a organizational diagram of some business. And say this map only contains the names of the employees and departments. But the view contains different checkboxes for altering the map. If I for instance press a certain checkbox, I would like to see the organizational map with both names AND titles of the employees. So in that case I want to send an int value of for example 1 to the Action to indicate what values the diagram should contain. Is there a way to declare this in the view?
Hi,
I'm facing an issue with popup of a Kendo MVC grid.
The Popup renders a custom "EditData.cshtml" view which is under the following folder structure--> Views/My/EditorTemplates/EditData.cshtml
But if I move the EditorTemplates folder to another folder say "controls" (eg; Views/My/Controls/EditorTemplates/EditData.cshtml), the EditData.cshtml template view is not found by the pop-up and renders the default popup.
The "EditData.cshtml" is also found if I move the Editortemplates folder to the Shared folder (Shared/EditorTemplates/EditData.cshtml).
I want to place the EditorTemplates under the Controls folder in this structure --> Views/My/Controls/EditorTemplates/EditData.cshtml
Any help would be highly appreciated:
Below is the sample Grid :
@(Html.Kendo().Grid<MyViewModel>()
.Name("aliasGrid")
.Columns(columns =>
{
columns.Bound(c => c.AccountNumber).Title("Account No").Width(30);
columns.Bound(c => c.Identifier).Title("Identifier").Width(40);
columns.Bound(c => c.Name).Title("Alias Name");
columns.Bound(c => c.Status.DisplayName).Title("Status/Reason");
columns.Template(@<text></text>).ClientTemplate(@"<a class='k-grid-edit' ><u>Edit</u></a>").Title("Action");
})
.Editable(x => x.Mode(GridEditMode.PopUp).TemplateName("EditData").Window(y=>y.Animation(false))) //rendering a view from the EditorTemplates folder
.Groupable()
.Sortable()
.Filterable()
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.Events(e => e.Edit("CheckAccess"))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetData", "My").Data("GetMemberNo"))
.Update(update => update.Action("UpdateData", "My"))
.PageSize(10)
.Model(model => model.Id(p => p.ID))
)
)

Im using DropDownList with remote data binding and it works great on Firefox and Chrome, but there is an issue with filtering on Internet Explorer. After few keystrokes it selects top filtered position automatically instead of just filter out unmatching positions.
Code i use:
01.Html.Kendo().DropDownList()02..Name("DropDown")03..DataTextField("Text")04..DataValueField("Value")05..Filter(FilterType.Contains)06..DataSource(source =>07. source.Read(read =>08. {09. read.Action("ReadMethod", "Applications");10. }))11..Events(e =>12. {13. e.Select("onSelect");14. e.DataBound("onLoad");15. })
Is there anything that can be done to fix that?


I have a grid that I'm using batch mode for editing. There are only 1 column in the grid that is editable the rest are editable(false). I want to be able to have tab navigation only stop on those editable cells. I've tried setting the tabindex for the non-editable ones to -1 and that doesn't work. I've tried changing my edit mode to InLine but then nothing is editable.
Thanks
Lee
Hi all.
In den Kendo UI docs there is a sample which I would like to use with the MVC wrapper.
But I have no idea how to tell a grid column to have aggregates. Like it is done in the docs.
Any ideas?
Kind regards
Bernd

Hi Team,
I am trying to create simple upload section using code shared further down, but it gives me below error saying validation is not defined error.
'Kendo.Mvc.UI.Fluent.UploadBuilder' does not contain a definition for 'Validation' and no extension method 'Validation' accepting a first argument of type 'Kendo.Mvc.UI.Fluent.UploadBuilder' could be found (are you missing a using directive or an assembly reference?)
I tried putting below in view but not fixed, not sure where this method comes from. Do i need to upgrade dll version as of now i am using 2014.3.1119.
@using Kendo.Mvc.Extensions;
Please suggest what i am missing. thanks.
@(Html.Kendo().Upload().Name("documentUploader").Messages(m => m.Select("Browse").UploadSelectedFiles("Upload")).Events(events =>events.Success("uploadSuccess") .Complete("uploadComplete") .Error("onError") .Upload("uploadClick")).Multiple(false).Async(a => a .Save("UploadDocument", "Document") .AutoUpload(false) .SaveField("uploadedDocuments")).Validation(validation => validation.AllowedExtensions(new string[] { ".zip", ".rar" }).MaxFileSize(3145728)))
Hello,
Is there any way to force a script (javascript/jquery) to wait for the Grid sync to complete?
OR any way to retrieve the grid's model with data so as to perform a last update manually?
Currently due to timing with the async calls:
$("#Grid").data("kendoGrid").saveChanges();
OR
$("#OfficerGrid").data().kendoGrid.dataSource.sync();
There is data-loss when navigating to another page if it is done too soon after these calls are made.
I have setup and stepped through the existing event calls for both the grid (http://docs.telerik.com/aspnet-mvc/api/Kendo.Mvc.UI.Fluent/GridEventBuilder) and datasource (http://docs.telerik.com/aspnet-mvc/api/Kendo.Mvc.UI.Fluent/DataSourceEventBuilder).
All around it seems the DataSource .Sync() event is the last one triggered.
Here is the definition for the Grid:
@(Html.Kendo().Grid<NexusPWI.ViewModels.Wizard.ReportingViewModel>()
.Name("Grid")
.Columns(c =>
{
c.Bound(vm => vm.FirstName).Width(120);
c.ForeignKey(vm => vm.LocationNumber, (System.Collections.IEnumerable)ViewData["LocationsList"], "LocationNumber", "Drop_Text").HtmlAttributes(new { onchange = "triggerDropChange(this);" }).Width(100).Hidden(Model.Locations_ColumnInitHidden);
c.Bound(vm => vm.State).Width(120);
c.Command(command => { command.Destroy(); }).Width(40);
c.Template(@<text></text>);//Blank Column to handle Scrollable variable width so headers do not skew
})
.Scrollable(s => s.Enabled(true).Height("auto"))//Scrollable to control column widths
.ToolBar(toolbar =>
{
toolbar.Template("<div class='col-lg-3'>" +
"<a class='pull-right k-button k-button-icontext k-grid-save-changes' href='javascript:void(0)'><span class='k-icon k-update'></span>Save All</a>" +
"<a class='pull-right k-button k-button-icontext k-grid-add' href='/Wizard/EmployeePayrollRead?EmployeeGrid-mode=insert'><span class='k-icon k-add'></span>Add Row</a>" +
"</div>");
})
.Editable(editable => editable.Mode(GridEditMode.InCell)
.CreateAt(GridInsertRowPosition.Bottom)
)
.Navigatable()
.Pageable()
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.ServerOperation(false)
.Events(events => events.Error("employeeGrid_error")
.RequestEnd("Grid_RequestEnd")
.Change("Grid_Delete")
.Sync("sendEnable")
)
.Model(model => model.Id(vm => vm.PolicyHolderPayroll_EmployeeGridId))
.PageSize(1000)
.Create("EmployeePayrollCreate", "Wizard")
.Read("EmployeePayrollRead", "Wizard")
.Update("EmployeePayrollUpdate", "Wizard")
.Destroy("EmployeePayrollDestroy", "Wizard")
))
With a call to navigate and save:
<a class='k-button k-button-icontext k-grid-save-changes pull-right' href='javascript:save_Grids_n_Move()'><span class='k-icon k-update'></span>Save All</a>
<script>
function save_Grids_n_Move() {
var Grid_save = $("#Grid").data().kendoGrid;
Grid_save.dataSource.sync();
element.closest("form").each(function () {
var form = $(this);
form.attr("action", action);
form.submit();
});
}
</script>
