Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
235
Editing DataGrid Paging Data Type
posted

Is there a way for me to edit the PageSizeList Data Type and keep the functionality

  • 530
    Offline posted

    Helllo Karen,

    The same question is also found on the following page. I answered to your question there. https://www.infragistics.com/community/forums/f/ignite-ui-for-asp-net-mvc/121789/editing-page-list-data-type

    Thank you,

    Yuki

  • 0
    Offline posted

    You can try these changes in your code to edit Page Size list

    public ActionResult Grid()
    {
    schoolEntities db = new schoolEntities();
    List<Student> result = db.Students.ToList();
    // I can't use pagesizelist here, taken from the view
    ViewBag.pageSize = int.Parse(pagesizelist.SelectedValue);
    return View(result);
    }
    and relating view:

    ...
    @Html.DropDownList("Page", new SelectList(new Dictionary<string, int> { { "10", 10 }, { "20", 20 }, { "50", 50 } }, "Key", "Value"), new { id = "pagesizelist" })

    <div class="code-cut">
    @Html.Grid(Model).Columns(Columns =>
    {
    Columns.Add(c => c.StudentID).Titled("Id").Filterable(true);
    Columns.Add(c => c.LastName).Titled("Last name").Filterable(true);
    Columns.Add(c => c.FirstName).Titled("First name").Filterable(true);
    Columns.Add(c => c.EnrollmentDate).Titled("Enrollment date").Filterable(true);
    Columns.Add()
    ...
    }).WithPaging(ViewBag.pageSize).Sortable(true)

    Hope this helps!

    Ben Martin

  • 0
    Offline posted

    Ayo dukung team kesayangan anda dan nonton live streaming nya hanya di bersama kami DEWABET dan Dewatogel
    Dapatkan juga berbagai bonus yang menarik dari kami, kumpulkan Turnover sebanyak-banyaknya!!!
    Silahkan anda Klik Link dibawah ini ya bos :

    dewabet

    dewatogel