Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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