or
<
html
>
<
head
>
<
meta
charset
=
"utf-8"
/>
<
title
>@ViewBag.Title</
title
>
<
link
href
=
"@Url.Content("
~/Content/Site.css")"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"@Url.Content("
~/Content/kendo.common.min.css")"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"@Url.Content("
~/Content/kendo.default.min.css")"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
script
src
=
"@Url.Content("
~/Scripts/modernizr-1.7.min.js")"
type
=
"text/javascript"
></
script
>
<
script
src
=
"@Url.Content("
~/Scripts/jquery.min.js")"
type
=
"text/javascript"
></
script
>
<
script
src
=
"@Url.Content("
~/Scripts/jquery-1.7.2.js")"
type
=
"text/javascript"
></
script
>
<
script
src
=
"@Url.Content("
~/Scripts/kendo/2012.2.710/kendo.web.min.js")"
type
=
"text/javascript"
></
script
>
<
script
src
=
"@Url.Content("
~/Scripts/kendo/2012.2.710/kendo.aspnetmvc.min.js")"
type
=
"text/javascript"
></
script
>
<
script
src
=
"@Url.Content("
~/Scripts/kendo/2012.2.710/kendo.grid.min.js")"
type
=
"text/javascript"
></
script
>
<
script
src
=
"@Url.Content("
~/Scripts/kendo/2012.2.710/kendo.menu.min.js")"
type
=
"text/javascript"
></
script
>
@RenderSection("HeadContent", required: false)
public ActionResult Index(string classifications = "")
{
ViewData["Category"] = classifications;
ViewData["Classifications"] = new SelectList(Classifications.List, "ClassificationText", "ClassificationText", classifications);
var codModels = new List<
CodeModel
>();
ViewBag.SelectedCatgory = classifications ?? "Type";
if (Request.HttpMethod == "POST")
{
var model = _codeRepository.Search(classifications).ToModel();
return View(model);
}
return View(codModels);
}
What is the difference between this line:
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ClientOrderViewModel>()
and this line:
@(Html.Kendo().Grid(Model)
I thought the first one is if you are connecting to a remote datasource. I tried the first one and it only seems to work if you are using json. I'm using the second and it is working for me.
Here is what my controller code looks like that works with the 2nd one and not the first.
public ActionResult Index(string classifications = "")
{
ViewData["Category"] = classifications;
ViewData["Classifications"] = new SelectList(Classifications.List, "ClassificationText", "ClassificationText", classifications);
var codModels = new List<
CodeModel
>();
ViewBag.SelectedCatgory = classifications ?? "Type";
if (Request.HttpMethod == "POST")
{
var model = _codeRepository.Search(classifications).ToModel();
return View(model);
}
return View(codModels);
}
/* Grid Buttons, remove background and change icon */ span.k-delete { background: url("../images/Delete.gif") center center; } span.k-edit { background: url("../images/Edit2.png") center center; } span.k-update { background: url("../images/save.gif") center center; } span.k-cancel { background: url("../images/cancel.png") center center; } .k-grid .k-button-icontext .k-icon { margin: 0; vertical-align: middle; } .k-grid tbody .k-button { min-width: 22px; width: 22px; background:none; border:0px; }
{
command: [{ name: "edit", text: "" }, { name: "destroy", text: "" }, { name: "update", text: "" }, { name: "cancel", text: ""}], title: "", width: 100 }