我在 Webgrid 的底部插入了链接按钮“添加新记录”和“全部保存”。但我希望它们位于WebGrid
. 我已经搜索了很多,但一无所获。有人可以告诉我如何在WebGrid
.
这是我的一些代码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="spanEmpId_@(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="spanEmpName_@(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="spanEmpDesg_@(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="Edit_@(item.EmpId)" class="edit">Edit</a>
<a href="#" id="Update_@(item.EmpId)" style="display:none" class="update">Update</a>
<a href="#" id="Cancel_@(item.EmpId)" style="display:none" class="cancel">Cancel</a>
<a href="#" id="Save_@(item.EmpId)" style="display:none" class="save">Update</a>
<a href="#" id="iCancel_@(item.EmpId)" style="display:none" class="icancel">Cancel</a>
<a href="#" id="Delete_@(item.EmpId)" class="delete">Delete</a>
</text>)
))