Many thanks the paging works perfect,
My other query on edit/del is still pending, i need to call a javascript function on edit button sending the selected row id.
In asp.net mvc grid my render column works perfect
code that i'm using is:
RenderedAs(o => $"<a name=\"ed\" id=\"ed\" href='#' onclick=hideme(Add);Add(" + new { o.regid } + ") ><img src='../images/editicon.png' height='20px' width='20px' alt='Image picture' /></a>");
columns.Add()
.Encoded(false)
.Sanitized(false)
.SetWidth(40)
.RenderValueAs(o => @<a href="#" onclick='hideme(Add); Sendid(@o.Regid)' data-modal='' id="ss" name="ss" data-id="@o.Regid" class="btn btn-success ss"> Add <span class='glyphicon glyphicon-user'> </span> <img src="~/images/editicon.png" width="20" height="20" /> </a>);
@{
ViewData["Title"] = "Referrals Page";
}
@using GridMvc
@using GridCore
@using Test.common.Resources
@addTagHelper*, Microsoft.AspNetCore.Mvc.TagHelpers
@model IEnumerable<RegUserRegisterResource>
@using NonFactors.Mvc.Grid;<script>
<script>
function hideme(name) {
alert("in hideme " + name);
}
function Add(Id) {
alert("in here "+ Id);
}
</script>
<h1 style="text-align:center"> My Referrals</h1>
@(
Html.Grid(Model).Build(columns =>
{
columns.Add(model => model.Firstname).Titled("User Name");
columns.Add(model => model.Email).Titled("User Email");
columns.Add(model => model.regid).Titled("Registration ID");
columns.Add()
.RenderedAs(o => $"<a name=\"ed\" id=\"ed\" href='#' onclick=hideme(Add);Add(" + new { o.regid } + ") ><img src='../images/editicon.png' height='20px' width='20px' alt='Image picture' /></a>");
}
).Sortable().Filterable().Empty("No data Found").Pageable(pager =>
{
pager.PageSizes = new Dictionary<Int32, String> { { 0, "All" }, { 5, "5" }, { 10, "10" }, { 50, "50" } };
pager.ShowPageSizes = false;
pager.PagesToDisplay = 3;
pager.CurrentPage = 1;
pager.RowsPerPage = 5;
})
)