【发布时间】:2015-07-02 13:01:59
【问题描述】:
我有一个使用远程绑定到旧 WCF 服务的剑道网格。我制作了一些新的 OData 服务,但当我切换时,我对 OData 不是属性感到困惑。
旧代码:
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
type: "odata", // <-- This property exist
transport: {
read: {
url: "http://localhost:49168/MyDataService.svc/Products",
data: { $expand: "Department,Editorial"}
}
},
不起作用的新代码
@(Html.Kendo().Grid<Product>()
.Name("grid")
.DataSource(dataSource => dataSource
.OData() // <-- This property does not exist but I would think it should
.Model(model => model.Id(c => c.Id))
.Read(read => read.Url("http://localhost:52706/odata/ProductsData"))
)
.Columns(columns =>
{
【问题讨论】:
标签: c# asp.net-mvc razor kendo-grid