1
我在Webgrid的底部插入了鏈接按鈕「添加新記錄」和「全部保存」。但我希望它們位於WebGrid
的頁腳中。我已經搜尋了很多,但什麼都沒找到。有人可以告訴我如何在WebGrid
的「頁腳」中添加鏈接或按鈕。在WebGrid的頁腳中添加鏈接按鈕Mvc3
這裏是我的WebGrid
@model IEnumerable<MvcGrid2.Models.Employee>
@{
WebGrid grid = new WebGrid(
source: Model,
rowsPerPage: 4);
}
@grid.GetHtml(htmlAttributes: new { id = "WebGrid1" },
tableStyle:"gridTable",
headerStyle: "gridHead",
footerStyle: "gridFooter",
rowStyle: "gridRow",
alternatingRowStyle: "gridAltRow",
mode: WebGridPagerModes.All,
firstText: "<<",
previousText: "<",
nextText: ">",
lastText: ">>",
columns: grid.Columns(
@* grid.Column(columnName : "EmployeeId",
format: @<text>@item.EmpId</text>),*@
grid.Column(columnName: "Employee Id",
format: @<span>
<span id="[email protected](item.EmpId)">@item.EmpId</span>
@Html.TextBox("EmpId_" + (int)item.EmpId, (int)item.EmpId, new { @style = "display:none" })
</span>),
grid.Column(columnName: "Employee Name",
format: @<span>
<span id="[email protected](item.EmpId)">@item.EmpName</span>
@Html.TextBox("EmpName_" + (int)item.EmpId, (string)item.EmpName, new { @style = "display:none" })
</span>),
grid.Column(columnName: "Designation",
format: @<span>
<span id="[email protected](item.EmpId)" >@item.Designation</span>
@Html.TextBox("EmpDesg_" + (int)item.EmpId, (string)item.Designation, new { @style = "display:none" })
</span>),
grid.Column(columnName: "Action",
format: @<text>
<a href="#" id="[email protected](item.EmpId)" class="edit">Edit</a>
<a href="#" id="[email protected](item.EmpId)" style="display:none" class="update">Update</a>
<a href="#" id="[email protected](item.EmpId)" style="display:none" class="cancel">Cancel</a>
<a href="#" id="[email protected](item.EmpId)" style="display:none" class="save">Update</a>
<a href="#" id="[email protected](item.EmpId)" style="display:none" class="icancel">Cancel</a>
<a href="#" id="[email protected](item.EmpId)" class="delete">Delete</a>
</text>)
))
Webgrid有頁腳,我已經閱讀了該教程。在這裏,沒有什麼可以在頁腳中添加控件。 –
澄清我的答案有點給你。 – Billdr