or
columns.Bound(p => p.StartDate).Format(
"{0:HH:mm}"
).Title(
"Tid"
);
<script src=
"@Url.Content("
~/Scripts/kendo/2012.3.1121/cultures/kendo.culture.sv-SE.min.js
")"
></script>
<script>
$(document).ready(function () {
//set culture of the Kendo UI
kendo.culture(
"sv-SE"
);
});
</script>
public
ActionResult Save(IEnumerable<HttpPostedFileBase> files,
string
uploadID)
{
}
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("Save", "Upload", new { uploadID = "XXX" })
.Remove("Remove", "Upload")
.AutoUpload(true)
)
)
.t-no-data
{
height
:
0px
;
}
@* Server Grid-Binding *@
@{
@(Html.Kendo().Grid(Model)
.Name(
"GridWFClasses"
)
.Columns(columns =>
{
columns.Bound(c => c.ID).Width(50).Title(WFClasses.ColumnID).Hidden(
true
);
columns.Bound(c => c.Reference).Template(
@<text>
<a href=
"javascript:redirectToControllerAction('@item.ControllerUrl')"
>@item.Reference</a>
</text>).Width(150).Title(WFClasses.ColumnReference);
columns.Bound(c => c.WFTemplateFile.FileName).Width(150).Title(WFClasses.ColumnTemplate);
columns.Bound(c => c.Description).Width(
"*"
).Title(WFClasses.ColumnDescription);
columns.Bound(c => c.Url).Width(250).Title(WFClasses.ColumnUrl);
columns.Bound(c => c.EditRights).Width(70).Title(WFClasses.ColumnEditRights);
})
.Resizable(m => m.Columns(
true
))
)
}
public
class
PersonModel
{
public
int
PersonId {
get
;
set
; }
[RegularExpression(@
"\+?\d[\d-]+\d"
)]
public
string
Phone {
get
;
set
; }
}
@(Html.Kendo().Grid<
PersonModel
>().Name("Persons")
.DataSource(src => src.Ajax()
.Model(model => model.Id(p => p.PersonId))
.Read("_GetPersons", "Account")
.Create("_CreatePerson", "Account")
.Update("_UpdatePerson", "Account")
.Destroy("_DestroyPerson", "Account")
.ServerOperation(true)
)
.ToolBar(command => command.Create())
.Columns(col =>
{
col.Bound(p => p.PersonId).Hidden();
col.Bound(p => p.Phone);
col.Command(command =>
{
command.Edit();
command.Destroy();
});
})
.Pageable()
.Editable(e => e.Mode(GridEditMode.PopUp))
)
[HttpPost]
public
ActionResult _UpdatePerson([DataSourceRequest] DataSourceRequest request, PersonModel model)
{
if
(model !=
null
&& ModelState.IsValid)
{
DB.UpdatePerson(model);
}
return
new
JsonNetResult { Data = ModelState.ToDataSourceResult() };
}
@(Html.Kendo().AutoCompleteFor(model => model.Location).Placeholder("Please select a value") .Name("locationAutoComplete").BindTo((IEnumerable<LocationData>)ViewData["locationList"]) .DataTextField("Name")) //Specifies which property of the Product to be used by the autocomplete. ;