kendo-grid

Show hidden columns in Kendo grid excel export

元气小坏坏 提交于 2019-12-01 18:37:57
I have a kendo grid and I can export its data into excel file without any problem. In my grid, some columns may be hidden because they do not have any value. However, I want even these hidden columns (I mean their header) be in my exported excel file. Here is a piece of code showing the excel config in my Kendo grid configuration. excel: { fileName: new Date().toString() + ".xlsx", allPages: true, }, Any help would be appreciated. You can have columns in an array which defines hidden: true and then simply traverse through columns array and show/hide columns just before export as following:

Kendo UI Grid Serial number column

喜欢而已 提交于 2019-12-01 17:47:12
I am trying to put the first column of the Kendo grid as the serial index, which is not affected by sorting of the row records. Is there any way I can achieve this? Thank You You can implement this using a template column. Here is a live demo showing how to do that: http://jsbin.com/olutin/10/edit Razim Khan Script Section <script> var rowNumber = 0; function resetRowNumber(e) { rowNumber = 0; } function renderNumber(data) { return ++rowNumber; } function renderRecordNumber(data) { var page = parseInt($("#Role").data("kendoGrid").dataSource.page()) - 1; var pagesize = $("#Role").data(

Controlling Group order in a Kendo UI Grid

帅比萌擦擦* 提交于 2019-12-01 15:37:21
Is there a way to control the order of the grouping in a Kendo UI grid. There is a group I would like to go before all other groups, but it seems Kendo UI grid sorts the groups alphabetically. I know that adding a space to the grouping name works but that's seems very hackish. Thanks Leo There is currently no way to sort a grouping on something other than the group's field. Having a way to sort groups like Telerik does in their non-Kendo grids is my biggest feature request for them right now. So we are stuck using hacks for now. One hack that works for me is to combine the sorting field and

Pager error in Kendo Grid(Nan-Nan of 1 items)

北城余情 提交于 2019-12-01 15:28:00
I am trying to create a Kendo grid with a list of student details. On click of the add button, the pager shows "Nan-Nan of 1 items". @(Html.Kendo().Grid<Student.Models.StudentDetails>() .Name("StudentDetailsGrid") .Pageable() .HtmlAttributes(new { id="StudentDetailsGrid"}) .Columns(col => {col.Bound(a => a.FirstName).Title("Name"); col.Bound(a => a.LastName).Hidden() col.Bound(a => a.StudentID).Hidden(); col.Command(a => { a.Destroy(); a.Edit(); }).Title(""); } ) .ToolBar(toolbar => toolbar.Create().Text("Add").HtmlAttributes(new {@id="btnCreateStudent"})) .Editable(editable => editable.Mode

Pager error in Kendo Grid(Nan-Nan of 1 items)

浪尽此生 提交于 2019-12-01 14:20:14
问题 I am trying to create a Kendo grid with a list of student details. On click of the add button, the pager shows "Nan-Nan of 1 items". @(Html.Kendo().Grid<Student.Models.StudentDetails>() .Name("StudentDetailsGrid") .Pageable() .HtmlAttributes(new { id="StudentDetailsGrid"}) .Columns(col => {col.Bound(a => a.FirstName).Title("Name"); col.Bound(a => a.LastName).Hidden() col.Bound(a => a.StudentID).Hidden(); col.Command(a => { a.Destroy(); a.Edit(); }).Title(""); } ) .ToolBar(toolbar => toolbar

LINQ to Entities - Addressing class properties with their string names

无人久伴 提交于 2019-12-01 14:04:54
I have a Kendo grid that has serverside filtering turned on. The field to filter by is passed as a string. For example, I want to filter by "SampleId". Now, I need to write a LINQ to Entities query that can filter by using the strongly-typed property SampleId. For example: db.Cases.Where(x=>targetlist.Contains(x.SampleId)) where targetlist is a list of items from the filter. So, in effect, is there a way to write a query such that "SampleId" can directly translate to Case.SampleId? I have tried reflection and made use of the GetProperty and GetValue and LINQ to Entities does not like it. Any

Why doesn't my KendoGrid call my MVC controller?

这一生的挚爱 提交于 2019-12-01 11:57:26
问题 I have the following code in a standard C# ASP.NET MVC controller. public JsonResult ReadTeachers() { return Json(ReadTeacherData(), JsonRequestBehavior.AllowGet); } public void UpdateTeachers(IEnumerable<Teacher> updatedTeachers) { // this is never called } I'm trying to call this controller with a KendoGrid. Here is the code for my grid. $("#teachers").kendoGrid({ dataSource: { type: "json", transport: { read: { url: '@Url.Action("ReadTeachers", "EducationPortal")', dataType: "json" },

Why doesn't my KendoGrid call my MVC controller?

此生再无相见时 提交于 2019-12-01 11:41:08
I have the following code in a standard C# ASP.NET MVC controller. public JsonResult ReadTeachers() { return Json(ReadTeacherData(), JsonRequestBehavior.AllowGet); } public void UpdateTeachers(IEnumerable<Teacher> updatedTeachers) { // this is never called } I'm trying to call this controller with a KendoGrid. Here is the code for my grid. $("#teachers").kendoGrid({ dataSource: { type: "json", transport: { read: { url: '@Url.Action("ReadTeachers", "EducationPortal")', dataType: "json" }, update: { url: '@Url.Action("UpdateTeachers", "EducationPortal")', dataType: "json" }, parameterMap:

Kendo Ui Grid not rebinding after search button click

有些话、适合烂在心里 提交于 2019-12-01 11:32:59
I having difficulty where the Kendo Ui grid would not rebind with new result after the Search button click.Please let me know how i could achieve this. Thank you Currently the GetList will return data correctly however the KendoUi grid would not rebind with the new result. .cshtml <div id="search"> <div> <div class="searchOption"> @Html.LabelFor(model => model.HRN) @Html.EditorFor(model => model.HRN) </div> </div> <div> <div class="smallBox"> <input type="button" id="btnSearch" style="height:32px; font-size:14px; background-color:#3399FF" class="k-button" title="Search" value="Search" /> </div

Kendo UI copying data through controls

邮差的信 提交于 2019-12-01 09:40:37
Is it possible to take 2 separate Kendo UI grids and be able to pass data back and forth through UI controls (like forward and backward arrows)? The pattern would would be to take the master list on the left, select items and have a refined list on the right. OnaBai If is possible and it is not hard to do but you have to do it by yourself so you need: Some knowledge on KendoUI Grid and DataSource and the events that they expose. Some knowledge on JavaScript + jQuery that help you with the validations and avoiding errors. Lets have the following grid definitions: var grid1 = $("#grid1")