or
@Html.Kendo().MultiSelectFor(model => model.Programs).BindTo((SelectList)ViewBag.Programs).DataTextField("Text").DataValueField("Id").Name("SelectedProgramIds ")
Models.Program[] obj = model.List();
ViewBag.Programs = new SelectList(obj, "Id", "Name", project.Programs);
public IEnumerable<
String
> SelectedProgramIds { get; set; }
@(Html.Kendo().Grid<
Pattern
>()
.Name("Pattern")
.ToolBar(toolbar =>
{
toolbar.Create().Text("New Pattern");
}
)
.DataSource(dataSource =>
dataSource.Ajax().PageSize(50)
.Model(model =>
{
model.Id(s => s.RegExID);
model.Field(s => s.Category).DefaultValue(new Category());
model.Field(s => s.Table).DefaultValue(new ExpressionTable());
model.Field(s => s.Version).DefaultValue("%");
}
)
.Create(create => create.Action("CreatePattern", "Pattern"))
.Destroy(destroy => destroy.Action("DeletePattern", "Pattern"))
.Update(update => update.Action("UpdatePattern", "Pattern"))
.Read(reader => reader.Action("LoadPattern", "Pattern"))
)
.Sortable()
.Selectable()
.Pageable(pager =>
{
pager.Enabled(true).Refresh(true).PageSizes(new int[] { 50, 100, 150 });
pager.Info(false);
})
.Scrollable(s => s.Enabled(true).Height(500))
.Filterable(filterable =>
filterable.Extra(false).Operators(operators => operators
.ForString(str =>
str.Clear()
.StartsWith("Starts with")
.Contains("Contains")
)
)
)
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("PatternPopUp")
)
)
<
div
class
=
"editor-label"
>
@Html.LabelFor(model => model.Table)
</
div
>
<
div
class
=
"editor-field"
>
@(Html.Kendo().DropDownListFor(model => model.Table)
.OptionLabel("Please select a value")
.HtmlAttributes(new { style = "width: 200px" })
.AutoBind(true)
.Name("Table")
.DataTextField("Name")
.DataValueField("TableID")
.Events(e =>
{
e.Select("select");
e.DataBound("bound");
}
)
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetRegExpressions", "Pattern");
})
.ServerFiltering(true);
})
)
</
div
>
<
div
id
=
"regSW"
>
<
div
class
=
"editor-label"
>
@Html.LabelFor(model => model.SoftwareName)
</
div
>
<
div
class
=
"editor-field"
>
@Html.EditorFor(model => model.SoftwareName)
@Html.ValidationMessageFor(model => model.SoftwareName)
</
div
>
<
div
class
=
"editor-label"
>
@Html.LabelFor(model => model.SoftwarePublisher)
</
div
>
<
div
class
=
"editor-field"
>
@Html.EditorFor(model => model.SoftwarePublisher)
@Html.ValidationMessageFor(model => model.SoftwarePublisher)
</
div
>
<
div
class
=
"editor-label"
>
@Html.LabelFor(model => model.Version)
</
div
>
<
div
class
=
"editor-field"
>
@Html.EditorFor(model => model.Version)
@Html.ValidationMessageFor(model => model.Version)
</
div
>
</
div
>
<
div
id
=
"regMachine"
>
<
div
class
=
"editor-label"
>
@Html.LabelFor(model => model.InstallSource)
</
div
>
<
div
class
=
"editor-field"
>
@Html.EditorFor(model => model.InstallSource)
@Html.ValidationMessageFor(model => model.InstallSource)
</
div
>
</
div
>
<
div
class
=
"editor-label"
>
@Html.LabelFor(model => model.Category)
</
div
>
<
div
class
=
"editor-field"
>
@(Html.Kendo().DropDownListFor(model => model.Category)
.OptionLabel("Please select a value")
.HtmlAttributes(new { style = "width: 200px" })
.AutoBind(false)
.Name("Category")
.DataTextField("Name")
.DataValueField("CategoryID")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetCategories", "Software");
})
.ServerFiltering(true);
})
)
</
div
>
<
div
class
=
"editor-label"
id
=
"regDeslbl"
>
@Html.LabelFor(model => model.Description)
</
div
>
<
div
class
=
"editor-field"
id
=
"regDesfld"
>
@Html.TextAreaFor(model => model.Description, new { @class = "k-textbox", style = "width: 200px" })
@Html.ValidationMessageFor(model => model.Description)
</
div
>
<
script
>
$("#regSW").hide();
$("#regMachine").hide();
</
script
>
01.
<
h2
>Groups</
h2
>
02.
<
br
/>
03.
04.
<
fieldset
>
05.
<
table
style
=
"border: none; width:97%"
>
06.
<
tr
>
07.
<
td
style
=
"text-align:left"
>
08.
<
input
type
=
"button"
id
=
"btnNewGroup"
value
=
"Create New Group"
onclick
=
"window.location = 'CreateGroup';"
style
=
"width:150px"
/>
09.
</
td
>
10.
</
tr
>
11.
</
table
>
12.
</
fieldset
>
13.
14.
<%= Html.Kendo().Grid(Model).Name("grid").HtmlAttributes(new { style = "width: 90%" })
15.
.DataSource(data => data
16.
.Server()
17.
.Model(model => model.Id(g => g.GroupID))
18.
.Destroy(delete => delete.Action("DeleteGroup", "Group"))
19.
)
20.
.Columns(columns =>
21.
{
22.
columns.Bound(o => o.Name).Width(400);
23.
columns.Bound(o => o.IsActive).Width(100);
24.
columns.Bound(o => o.ContactCount).Width(100);
25.
columns.Command(com =>
26.
{
27.
com.Custom("EditGroup").Text("Edit").Action("UpdateGroup", "Group").SendDataKeys(true).HtmlAttributes(new { style="width:80px" });
28.
com.Destroy().Text("Delete").HtmlAttributes(new { style = "width:80px" });
29.
});
30.
})
31.
.Sortable()
32.
.Editable(editing => editing.DisplayDeleteConfirmation(true))
33.
.Scrollable()
34.
%>
<script>
var
event =
new
kendo.data.SchedulerEvent({
id: 1,
start:
new
Date(
"2013/9/2 12:00"
),
end:
new
Date(
"2013/9/2 12:30"
),
title:
"Lunch"
,
recurrenceRule:
"FREQ=MONTHLY;COUNT=2;BYMONTHDAY=15"
});
</script>