Created
July 21, 2015 10:59
-
-
Save shou1sannomiya/860ef4263f59ecd5daa6 to your computer and use it in GitHub Desktop.
iggrid Updating.ColumnEditorType.Combo.DataSource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Controller 抜粋 | |
public ActionResult Index() | |
{ | |
//コンボリスト用のデータソースをViewBagにセットする | |
IList<cmbdata> data = GetLanguageNameIDList(); | |
ViewBag.LanguageNameIDList = data; | |
return View(); | |
} | |
//cshtml 抜粋 | |
fatures.Updating().EditMode(GridEditMode.Row) | |
.ColumnSettings(settings => | |
{ | |
settings.ColumnSetting().ColumnKey("LanguageNameID").Required(true) | |
.EditorType(ColumnEditorType.Combo) | |
.ComboEditorOptions(options => | |
{ | |
//options.DataSourceUrl(Url.Action("GetLanguageNameIDList")); | |
options.DataSource(ViewBag.LanguageNameIDList); | |
options.Mode(ComboMode.DropDown); | |
options.ShowDropDownButton(true); | |
options.ValueKey("Value"); | |
options.TextKey("DisplayName"); | |
options.EnableClearButton(false); | |
options.DropDownOnFocus(true); | |
options.SelectItemBySpaceKey(true); | |
}); | |
}); | |
Enter file contents here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment