or
@ModelType Object
@code
Dim DropDown As Kendo.Mvc.UI.DropDownList = Html.Kendo().DropDownListFor(Function(m) m).BindTo(CType(ViewData(ViewData.TemplateInfo.GetFullHtmlFieldName(String.Empty) & "_Data"), SelectList))
DropDown.Render()
End Code
@ModelType IEnumerable(Of EF.Team)
@code
Dim CsvGrid As Kendo.Mvc.UI.Grid(Of BO.Models.Contractor.CsvUploadData) = Html.Kendo.Grid(Of BO.Models.Contractor.CsvUploadData).Name("CsvGrid") _
.Columns(Sub(columns)
columns.Bound(Function(c) c.FirstName)
columns.Bound(Function(c) c.LastName)
columns.Bound(Function(c) c.Email)
columns.Bound(Function(c) c.FirstbookingDate)
columns.Bound(Function(c) c.FullService)
columns.Bound(Function(c) c.PoolSize)
columns.Bound(Function(c) c.Spa)
columns.Bound(Function(c) c.Street)
columns.Bound(Function(c) c.Zipcode)
columns.ForeignKey(Function(f) f.TeamId, Model, "TeamId", "Name").Width(200).Title("Team")
columns.Command(Function(Command) Command.Destroy())
End Sub) _
.ToolBar(Sub(toolbar)
toolbar.Create()
toolbar.Save()
End Sub) _
.Editable(Function(editable) editable.Mode(GridEditMode.InCell)) _
.Pageable() _
.Navigatable() _
.Sortable() _
.Scrollable() _
.DataSource(Function(dataSource) dataSource _
.Ajax() _
.Batch(True) _
.ServerOperation(False) _
.Events(Function(events) events.Error("CsvUpload.GridEditError")) _
.Model(Sub(Model)
Model.Id(Function(d) d.CsvUploadDataId)
Model.Field(Function(f) f.TeamId).DefaultValue(1)
End Sub) _
.Create("Editing_Create", "Grid") _
.Read("csvuploadgriddata", "services", New With {.area = String.Empty}) _
.Update("Editing_Update", "Grid") _
.Destroy("Editing_Destroy", "Grid"))
CsvGrid.Render()
End Code
<
html
>
<
head
>
<
meta
name
=
"viewport"
content
=
"width=device-width"
/>
<
title
>Test Page</
title
>
<
script
src
=
"/Scripts/modernizr-2.5.3.js"
></
script
>
<
link
href
=
"/Content/kendo.common.min.css"
rel
=
"stylesheet"
/>
<
link
href
=
"/Content/kendo.default.min.css"
rel
=
"stylesheet"
/>
<
script
src
=
"/Scripts/jquery-1.8.3.js"
></
script
>
<
script
src
=
"/Scripts/kendo.web.min.js"
></
script
>
<
script
src
=
"/Scripts/kendo.all.min.js"
></
script
>
<
script
src
=
"/Scripts/kendo.aspnetmvc.min.js"
></
script
>
<
script
src
=
"/Scripts/jquery.unobtrusive-ajax.min.js"
></
script
>
<
script
src
=
"/Scripts/cultures/kendo.culture.en-ZA.min.js"
></
script
>
</
head
>
<
body
>
<
div
class
=
"demo-section"
>
<
h2
>Invite Attendees</
h2
>
<
label
for
=
"required"
>Required</
label
>
<
select
id
=
"required"
multiple
=
"multiple"
name
=
"required"
></
select
><
script
>
jQuery(function(){jQuery("#required").kendoMultiSelect({"dataSource":["Steven White","Nancy King","Anne King","Nancy Davolio","Robert Davolio","Michael Leverling","Andrew Callahan","Michael Suyama","Anne King","Laura Peacock","Robert Fuller","Janet White","Nancy Leverling","Robert Buchanan","Andrew Fuller","Anne Davolio","Andrew Suyama","Nige Buchanan","Laura Fuller"],"placeholder":"Select attendees...","value":["Anne King","Andrew Fuller"]});});
</
script
>
<
label
for
=
"optional"
>Optional</
label
>
<
select
id
=
"optional"
multiple
=
"multiple"
name
=
"optional"
></
select
><
script
>
jQuery(function(){jQuery("#optional").kendoMultiSelect({"dataSource":["Steven White","Nancy King","Anne King","Nancy Davolio","Robert Davolio","Michael Leverling","Andrew Callahan","Michael Suyama","Anne King","Laura Peacock","Robert Fuller","Janet White","Nancy Leverling","Robert Buchanan","Andrew Fuller","Anne Davolio","Andrew Suyama","Nige Buchanan","Laura Fuller"],"placeholder":"Select attendees..."});});
</
script
>
<
button
class
=
"k-button"
id
=
"get"
>Send Invitation</
button
>
</
div
>
<
script
>
$(document).ready(function () {
var required = $("#required").data("kendoMultiSelect");
var optional = $("#optional").data("kendoMultiSelect");
$("#get").click(function () {
alert("Attendees:\n\nRequired: " + required.value() + "\nOptional: " + optional.value());
});
});
</
script
>
<
style
scoped>
.demo-section {
width: 350px;
height: 200px;
padding: 30px;
}
.demo-section h2 {
font-weight: normal;
}
.demo-section label {
display: inline-block;
margin: 15px 0 5px 0;
}
.demo-section select {
width: 350px;
}
#get {
float: right;
margin: 25px auto 0;
}
</
style
>
</
body
>
</
html
>
@(Html.Kendo().Editor()
.Name("editor")
.HtmlAttributes(new { style = "width: 740px;height:440px" })
.Value(@<
text
>@ViewBag.FirstText</
text
>
))
public ActionResult ShowEditor(int id)
{
ViewBag.FirstText = "<
a
>bbb</
a
>";
return View();
}
$(e.form).find(
".t-grid-cancel"
).click(
function
() {
if
(e.mode ==
"insert"
) {
//do insert cancel cleanup code
}
});
3. What is the Kendo equivalent of this:
$(e.form).find(
".t-grid"
).data(
"tGrid"
).ajaxRequest({ InventoryItemId: key });
3. In the Save client event, what would be the equivalent of this code for Kendo?
e.values.inventoryItemId = key;
I think that is enough to start with..
Thanks in advance for any help!
@(Html.Kendo().EditorFor(model => model.Message.MessageText)
.Name("Message.MessageText")
.HtmlAttributes(new { style = "height:550px" })
.Tools(tools => tools
.Clear()
.Bold()
.Italic()
.Underline()
.Strikethrough()
.FontColor()
.BackColor()
.InsertOrderedList()
.InsertUnorderedList()
.Indent()
.Outdent()
.CreateLink()
.Unlink()
)
)
@(Html.Kendo().Grid<BillHeader>()
.Name(
"BillHeaders"
)
.Columns(columns =>
{
columns.Bound(h => h.BillHeaderId);
columns.Bound(h => h.Category);
columns.Bound(h => h.Description);
columns.Bound(h => h.Amount);
})
.Pageable()
.Selectable(selectable => selectable
.Mode(GridSelectionMode.Multiple)
.Type(GridSelectionType.Row))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(6)
.Events(events => events.Error(
"error_handler"
))
.Read(read => read.Action(
"BillHeaders_Read"
,
"Bill"
))
)
.Events(events => events.DataBound(
"dataBound"
))
.ClientDetailTemplateId(
"BillDetails"
)
)
<script id=
"BillDetails"
type=
"text/kendo-tmpl"
>
@(Html.Kendo().Grid<BillDetail>()
.Name(
"BillDetails_#=BillHeaderId#"
)
.Columns(columns =>
{
columns.Bound(d => d.BillHeaderId).Width(50);
columns.Bound(d => d.BillDetailId).Width(70);
columns.Bound(d => d.Category).Width(70);
columns.Bound(d => d.Description).Width(150);
columns.Bound(d => d.Amount).Width(80);
columns.Command(command =>
{
command.Edit();
command.Destroy();
}).Width(75);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Model(model =>
{
model.Id(d => d.BillDetailId);
model.Field(d => d.BillDetailId).Editable(
false
);
})
.Events(events => events.Error(
"error_handler"
))
.Read(read => read.Action(
"BillDetails_Read"
,
"Bill"
,
new
{ billHeaderId =
"#=BillHeaderId#"
}))
.Update(update => update.Action(
"BillDetail_Update"
,
"Bill"
))
.Create(create => create.Action(
"BillDetail_Create"
,
"Bill"
,
new
{ billHeaderId =
"#=BillHeaderId#"
}))
.Destroy(destroy => destroy.Action(
"BillDetail_Destroy"
,
"Bill"
)))
.Pageable()
.ToolBar(tools => tools.Create())
.ToClientTemplate()
)
</script>
[AcceptVerbs(HttpVerbs.Post)]
public
ActionResult BillDetail_Create(BillDetail billDetail,
int
billHeaderId)
{
if
(billHeaderId == 0)
{
ModelState.AddModelError(
"billHeaderID"
,
"add bill header first"
);
}
if
(billDetail !=
null
&& ModelState.IsValid)
{
var target =
new
BillDetail
{
Category = billDetail.Category,
Description = billDetail.Description,
Amount = billDetail.Amount,
BillHeaderId = billHeaderId,
BillDetailId = SessionBillDetails.Max(d => d.BillDetailId) + 1
};
//Get next Id in sequence
billDetail.BillDetailId = target.BillDetailId;
SessionBillDetails.Add(target);
}
return
Json(
new
[] { billDetail }.ToDataSourceResult(
new
DataSourceRequest(), ModelState));
}