Hi,
I have a grid showing several columns like this:
columns.Bound(c => c.WeekNumber).ClientGroupHeaderTemplate("KW: #=value#").Hidden(true);
columns.Bound(c => c.Date).Format("{0:dddd dd.MM.yy}") ;
columns.ForeignKey(c => c.ThisToSoup, (IEnumerable<
EECanteen.Models.FoodItem
>)ViewData["Soups"], "ID", "Name").Width(200);
columns.ForeignKey(c => c.ThisToMenuOne, (IEnumerable<
EECanteen.Models.FoodItem
>)ViewData["Menus"], "ID", "Name").Width(200);
columns.ForeignKey(c => c.ThisToMenuTwo, (IEnumerable<
EECanteen.Models.FoodItem
>)ViewData["Menus"], "ID", "Name").Width(200);
columns.ForeignKey(c => c.ThisToMenuThree, (IEnumerable<
EECanteen.Models.FoodItem
>)ViewData["Menus"], "ID", "Name").Width(200);
columns.ForeignKey(c => c.ThisToCake, (IEnumerable<
EECanteen.Models.FoodItem
>)ViewData["Cakes"], "ID", "Name").Width(200);
columns.Bound(c => c.Salads).ClientTemplate("#=SaladsTemplate(Salads)#");
columns.Command(command => { command.Destroy(); command.Edit(); }).Width(180);
I want to display a tooltip for the foreign key and for the selected items in the "Salads" column.
And I want to load the data via Ajax using a controller method where I pass the ForeignKey.
Fortunately these Key (also for the Salads) reference the same table in my database.
I also have this ID in my Salads Template which is built like this:
<
script
type
=
"text/kendo"
id
=
"SaladsTemplate"
>
<
strong
>
#for(var i = 0; i<
data.length
; i++){#
<a
title
=
"#:data[i].Name#"
data-id
=
"#:data[i].ID#"
href
=
""
>#:data[i].Name#</
a
>
#}#
</
strong
>
</
script
>
<
script
type
=
"text/javascript"
>
var SaladsTemplate = kendo.template($("#SaladsTemplate").html(), { useWithBlock: false });
</
script
>
By the way - I want no tooltip on the Date and other columns (not shown here).
Manfred
Hi,
We're using the Kendo Editor in a custom editor template for fields in a kendo grid in in-cell edit mode.
It mainly works, but one issue is that sometimes using toolbar tools like foreColor seems to cause the editor blur event to fire, which closes the editor.
Is this a bug or is there a suggested work-around for this?
Hi there!
I was facing an issue and have been struggling with it since Friday but couldn't find any solution to it.
While searching on internet I found the same issue on you samples and demos website, if you go to this link:
http://demos.telerik.com/kendo-ui/grid/editing-inline
If you click on "Add New Record" button, a new empty row is added into the grid, now without saving this new row, if you click on Edit button in any of other rows, the empty row that was added against Add action gets removed, which is fine, but the row which you want to Edit, it doesn't come up in editable mode.
Is there any fix for it or it is the behavior of the grid?
Regards
Waqar
I am following along with the demo found here: http://www.telerik.com/videos/aspnet-mvc/-persistedvalue-kendo-ui-for-asp-net-mvc-treeview-value-kendo-ui-for-asp-net-mvc-treeview and compared with the documentation here: http://demos.telerik.com/aspnet-mvc/treeview/remote-data-binding and there is no network traffic for subsequent child node requests that includes the id of the parent node. What results is a never ending list of "Andrew Fuller"s.
I am operating in Visual Studio 2013 premium with EF 6.1 and SQL server 2014 hosting the Northwind database and the app being run on MVC 5 platform. The static Tree List displayed fine however upon attempting to perform the updates it stopped working.
This overall has been a pretty poor experience with the trial period and I am wondering exactly what I am doing wrong to be experiencing these issues.
Hi,
Is there a way to specify a specific x-coordinate for each point in a line chart, independent of the category? The reason is I need to create a chart of points that aren't evenly distributed, alongside a denser set of points that are.
Also, when I try to plot them on the same CategoryAxis, the denser plot ends up just adding additional ticks to the category, which I don't want.
Thanks
I have a hierarchical grid and a button on child grid which on click opens a window and there is a grid on that window. When on click of the button on child grid , i am trying to reload the grid on the window, but throwing an exception $(...).data(...).kendoGrid is undefined. upon all this, it has been working perfectly fine for one month and suddenly it is not fetching any rows. when i debugged it is throwing this exception. may i know what has changed suddenly even though i haven't changed anything on this page.
parent grid
<
div
class
=
"container-fluid"
>
<
div
class
=
"row"
>
<
div
class
=
"col-xs-18 col-md-12"
>
@(Html.Kendo().Grid<
BHEBS.Areas.Admin.Models.ContractModel.providers
>()
.Name("grid")
.Columns(columns =>
{
//columns.Bound(p => p.Id).Filterable(false).Width(50);
columns.Bound(p => p.ContractorType);
columns.Bound(p => p.BHSISNum);
columns.Bound(p => p.StartDate).Format("{0:MM/dd/yyyy}");
columns.Bound(p => p.EndDate).Format("{0:MM/dd/yyyy}");
columns.Bound(p => p.ContractorIsAlsoRegion);
columns.Bound(p => p.ContractorName);
columns.Bound(p => p.AddressBkNum);
columns.Command(command => command.Custom("Remove").Text("Remove").SendDataKeys(true).Click("deleteClick").HtmlAttributes(new { @class = "k-button k-button-icontext k-grid-add k-primary" }));
}).Events(e => e.DataBound("onDataBound"))
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.Selectable()
.ClientDetailTemplateId("template")
.HtmlAttributes(new { style = "height:550px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Contractors_Read", "Contract").Data("additionalInfo"))
)
@*.ToolBar(toolbar =>
{
toolbar.Template(@<
text
>
<
div
class
=
"toolbar"
>
<
button
class
=
"k-button k-button-icontext k-grid-add k-primary"
id
=
"providerskendowindow"
>Add Providers</
button
>
</
div
>
</
text
>);
})*@
)
</
div
>
</
div
>
</
div
>
child grid
<
script
id
=
"template"
type
=
"text/kendo-tmpl"
>
@(Html.Kendo().Grid<
BHEBS.Areas.Admin.Models.ContractModel.serviceDetails
>()
.Name("grid_#=Id#")
.Columns(columns =>
{
// columns.Bound(o => o.Id).Width(50);
columns.Bound(o => o.ServiceId);
columns.Bound(o => o.ServiceType);
columns.Bound(o => o.AdultChild);
columns.Bound(o => o.Qualifier);
columns.Bound(o => o.CodeModifier);
columns.Bound(o => o.ServiceModifier);
columns.Bound(o => o.StartDate).Format("{0:MM/dd/yyyy}");
columns.Bound(o => o.EndDate).Format("{0:MM/dd/yyyy}");
columns.Command(command => command.Custom("Remove").SendDataKeys(true).Click("deleteClickServices"));
}).Events(e => e.DataBound("onDataBoundServices"))
.ToolBar(toolbar =>
{
toolbar.Template(@<
text
>
<
div
class
=
"toolbar"
>
<
button
class
=
"k-button k-button-icontext k-grid-add k-primary"
id
=
"serviceskendowindow"
>Assign Services</
button
>
</
div
>
</
text
>);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Read(read => read.Action("Services_Read", "Contract", new { contractorId = "#=Id#", contractId = ViewBag.ContractService.Id }))
)
.Pageable()
.Sortable()
.ToClientTemplate()
)
</
script
>
window on click of button on child grid
@(Html.Kendo().Window()
.Name("servicewindow")
.Title("Assign Services")
.Content(@<
text
><
div
class
=
"container-fluid"
>
<
div
class
=
"row"
>
<
div
class
=
"col-xs-18 col-md-12"
>
@(Html.Kendo().Grid<
BHEBS.Areas.Admin.Models.ContractModel.serviceDetails
>()
.Name("gridServicesWindow")
.Columns(columns =>
{
columns.Template(x => { }).HtmlAttributes(new { @class = "chkbox" }).ClientTemplate("<
input
type
=
'checkbox'
class
=
'checkbox'
id
=
'chkBoxServices'
/>");
columns.Bound(p => p.Id).Filterable(false).Width(50);
columns.Bound(p => p.ServiceId);
columns.Bound(p => p.ServiceType);
columns.Bound(p => p.StartDate).Format("{0:MM/dd/yyyy}");
columns.Bound(p => p.EndDate).Format("{0:MM/dd/yyyy}");
columns.Bound(p => p.AdultChild);
})
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.AutoBind(false)
.Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple))
.HtmlAttributes(new { style = "height:350px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("GetAllServices_Read", "Contract").Data("additionalInfoAddServices{('#=Id#');}"))
)
)
<
button
class
=
"k-button close-buttonservices k-primary"
style
=
"bottom: 10px; "
>Cancel</
button
>
<
button
class
=
"k-button k-primary"
id
=
"addSelectedServices"
style
=
"bottom: 10px; "
>Assign</
button
>
</
div
>
</
div
>
</
div
></
text
>
)
.Draggable()
.Resizable()
.Width(800)
.Modal(true)
.Visible(false)
)
on click of button on child grid
$("#grid").on("click", "#serviceskendowindow", function(e){
$("#servicewindow").data("kendoWindow").center().open();
var grid = $("#grid").data("kendoGrid");
var row= grid.dataItem($(e.target).closest(".k-detail-row").prev(".k-master-row"));
addSelectedContractorService = row.Id;
$('#gridServicesWindow').data().kendoGrid.dataSource.read();
});
$("#gridServicesWindow").on("click", ".checkbox", function (e) {
var checked = $(this).is(":checked");
row = $(this).closest("tr");
var grid = this; // this is not even identifying here so changed to this line
// var grid = $("#gridServicesWindow").data("kendoGrid");
var model = grid.dataItem(row);
checkedServiceIds[model.Id] = checked;
});
I have a MVC grid and it seems that if I pick a column to sort it actually sorts the column to the right.
Below is my razor code. Not sure why this is happening.
Thanks,
Matthew
@(Html.Kendo().Grid(Model)
.Columns(columns =>
{ columns.Bound("").Locked(true).Filterable(true).Sortable(false).ClientTemplate("imagePath;").Width(75).Title("").Groupable(false);; columns.Bound(c => c.Code).Title("Code");
columns.Bound(c => c.ShortName).Title("ShortName");
columns.Bound(c => c.Name).Title("Name");
columns.Bound("").ClientTemplate("#=Description#, #=Comment#).Title("Desc");columns.Bound("").Locked(true).HtmlAttributes(new { @class = "k-group-cell" }).Width(60).Title("").Filterable(false).Sortable(false).Groupable(false).ClientTemplate();
})
.Groupable()
.Filterable()
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Cell))
.Sortable(sortable => sortable
.SortMode(GridSortMode.MultipleColumn))
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.DataSource(dataSource =>dataSource
.Ajax()
.Sort(sort => sort.Add("Code").Ascending())
.PageSize(50)
.ServerOperation(false)
)
)