Telerik ListBoxにデータを流し込む方法 ASP.NET MVC5の場合
Day.cshtml
@(Html.Kendo().ListBox()
.Name("optional")
.Toolbar(toolbar => {
toolbar.Position(Kendo.Mvc.UI.Fluent.ListBoxToolbarPosition.Right);
toolbar.Tools(tools => tools
.TransferTo()
.TransferFrom()
.TransferAllTo()
.TransferAllFrom()
.Remove()
);
})
.ConnectWith("selected")
)
@(Html.Kendo().ListBox()
.Name("selected")
.Selectable(ListBoxSelectable.Multiple)
.BindTo(ViewBag.SelectUsers)
)
DayController.cs
//
List<SelectListItem> selectusers = new List<SelectListItem>();
var item = new SelectListItem();
item.Text = "担当者";
item.Value = "0101";
selectusers.Add(item);
ViewBag.SelectUsers = selectusers;
0 件のコメント:
コメントを投稿