Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding a link button in the footer of WebGrid Mvc3
    text
    copied!<p>I have inserted the link buttons "Add New Record" and "Save All" at the bottom of my Webgrid. But I want them to be in the footer of the <code>WebGrid</code>. I have searched for this a lot, but found nothing. Can someone tell me how to add a link or button in the "footer" of a <code>WebGrid</code>.</p> <p>Here is some code of my <code>WebGrid</code></p> <pre><code>@model IEnumerable&lt;MvcGrid2.Models.Employee&gt; @{ 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: "&lt;&lt;", previousText: "&lt;", nextText: "&gt;", lastText: "&gt;&gt;", columns: grid.Columns( @* grid.Column( columnName : "EmployeeId", format: @&lt;text&gt;@item.EmpId&lt;/text&gt;),*@ grid.Column(columnName: "Employee Id", format: @&lt;span&gt; &lt;span id="spanEmpId_@(item.EmpId)"&gt;@item.EmpId&lt;/span&gt; @Html.TextBox("EmpId_" + (int)item.EmpId, (int)item.EmpId, new { @style = "display:none" }) &lt;/span&gt;), grid.Column(columnName: "Employee Name", format: @&lt;span&gt; &lt;span id="spanEmpName_@(item.EmpId)"&gt;@item.EmpName&lt;/span&gt; @Html.TextBox("EmpName_" + (int)item.EmpId, (string)item.EmpName, new { @style = "display:none" }) &lt;/span&gt;), grid.Column(columnName: "Designation", format: @&lt;span&gt; &lt;span id="spanEmpDesg_@(item.EmpId)" &gt;@item.Designation&lt;/span&gt; @Html.TextBox("EmpDesg_" + (int)item.EmpId, (string)item.Designation, new { @style = "display:none" }) &lt;/span&gt;), grid.Column(columnName: "Action", format: @&lt;text&gt; &lt;a href="#" id="Edit_@(item.EmpId)" class="edit"&gt;Edit&lt;/a&gt; &lt;a href="#" id="Update_@(item.EmpId)" style="display:none" class="update"&gt;Update&lt;/a&gt; &lt;a href="#" id="Cancel_@(item.EmpId)" style="display:none" class="cancel"&gt;Cancel&lt;/a&gt; &lt;a href="#" id="Save_@(item.EmpId)" style="display:none" class="save"&gt;Update&lt;/a&gt; &lt;a href="#" id="iCancel_@(item.EmpId)" style="display:none" class="icancel"&gt;Cancel&lt;/a&gt; &lt;a href="#" id="Delete_@(item.EmpId)" class="delete"&gt;Delete&lt;/a&gt; &lt;/text&gt;) )) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload