Skip to content

Instantly share code, notes, and snippets.

@shou1sannomiya
Created July 16, 2015 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shou1sannomiya/35ada3db61fe390ed8b0 to your computer and use it in GitHub Desktop.
Save shou1sannomiya/35ada3db61fe390ed8b0 to your computer and use it in GitHub Desktop.
iggridのTemplate使用事例
@* 伝票一覧グリッド *@
@(Html.Infragistics()
.Grid<Den_List>()
.ID("gridList")
.LoadOnDemand(false).AutoGenerateColumns(false).AutoGenerateLayouts(false)
.PrimaryKey("HogeId").Width("730px").Height("570px")
.Columns(column =>
{
column.For(x => x.HogeId).DataType("number").Hidden(true); //PrimaryKey
column.For(x => x.Icon).HeaderText(" ").Width("32px").DataType("string")
.Template("<IMG SRC=${Icon} style = 'width:20px;height:20px'></IMG>");//②画像の表示例
column.For(x => x.Editimg).HeaderText(@rsGlobal.Editimg).Width("30px").DataType("string")
.Template("<input type='image' SRC=${Editimg} onclick='editgridList(${HogeId})' class='select-button' style = 'width:20px;height:20px' />");//③function呼び出し
column.For(x => x.Kingaku).DataType("number").HeaderText(@rsGlobal.Kingaku).Width("90px").Format(@ViewBag.KingakuFormat)
.Template("<div align=right>${Kingaku}</div>"); //①金額右寄せ
})
.DataSourceUrl(Url.Action("GetGridData", new { Id = ViewBag.HogeId }))
.DataBind().Render())
@*end 一覧グリッド *@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment