or
@{
Html.Kendo().Window()
.Name(
"popupwindow"
)
.Title(
"Title Of Window"
)
.Draggable()
.LoadContentFrom(
"MyAction"
,
"MyController"
)
.Draggable(
true
)
.Width(800)
.Modal(
true
)
.Scrollable(
true
)
.Visible(
false
)
.Render();
}
@( Html.Kendo().Grid<MyProject.ViewModels.MyObject>()
.Name(
"MyGrid"
)
.Columns(col =>
{
col.Bound(p => p.ID);
col.Bound(p => p.SomeField)
;
col.ForeignKey(p => p.SomeOtherID,(System.Collections.IEnumerable)ViewBag.ListOptions,
"Value"
,
"Text"
)
;
})
.Editable(edit => edit.Mode(GridEditMode.InCell))
.Scrollable()
.DataSource(ds =>
ds.Ajax()
.ServerOperation(
false
)
.Model(model =>
{
model.Id(p => p.ID);
model.Field(p => p.SomeOtherID).DefaultValue(0);
})
.Read(
"_Read"
,
"MyController"
)
.Update(
"_Update"
,
"MyController"
)
)
.ToolBar(tool =>
{
// Removed for this post
})
)
<
div
class
=
"row-fluid"
>
<
div
class
=
"span3"
>
CID
<
input
class
=
"input-small"
type
=
"text"
id
=
"cid"
>
</
div
>
<
div
class
=
"span3"
>
<
button
type
=
"button"
id
=
"Search"
class
=
"btn btn-primary btn-small"
>Search</
button
>
<
button
type
=
"button"
id
=
"Reset"
class
=
"btn btn-small"
>Reset</
button
>
</
div
>
</
div
>
<
div
class
=
"span12"
>
@(Html.Kendo().Grid(Model).Name("grid").Columns(columns =>
{
columns.Bound(p => p.CopyComment)
.Title("Copy")
.ClientTemplate("<
input
type
=
'checkbox'
#= CopyComment ?
checked
=
'checked'
: '' #
class
=
'chkbx'
/>")
.HtmlAttributes(new { style = "text-align: center" })
.Width(50);
columns.Bound(p => p.CID);
columns.Bound(p => p.Surname);
columns.Bound(p => p.Suburb);
columns.Bound(p => p.FID);
columns.Bound(p => p.CommentDate);
columns.Bound(p => p.SalesClerk);
columns.Bound(p => p.Comments);
columns.Bound(p => p.Village);
columns.Bound(p => p.CommentClass);
columns.Bound(p => p.UnitNo);
columns.Bound(p => p.ActivityTypeName);
columns.Bound(p => p.ActivityMethodName);
columns.Bound(p => p.HeardAbout);
columns.Bound(p => p.NewspaperName);
columns.Bound(p => p.CampaignName);
}).Sortable()
.Scrollable(scr => scr.Height(400))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetSalesComments", "CopySalesComments")
)
)
)
</
div
>
public
ActionResult GetSalesComments(
int
? cid)
{
//Do search here and
return
result
return
Json(...);
}
C:\Program Files (x86)\Telerik\Kendo UI for ASP.NET MVC Q1 2013\wrappers\aspnetmvc\Binaries\Mvc3