Click here to Skip to main content
15,896,118 members

Telerik Paging is not working

M Ali Qadir asked:

Open original thread
Hi,

I have following code in my _DonationList.cshtml file and paging is not working here in this code please let me know where I am going wrong.
In fact When run this code it shows me Grid, but when i click on pages, it show me following URL in the Page
http://localhost:61122/Grid/FirstLook?Grid-page=2
It shouldn't do this but it should show me like
http://localhost:61122/Donation?Grid-page=2
Please Let me know is there any Problem in my code or there is any other problem.
C#
@(Html.Telerik().Grid(Model)
        .Name("Grid")
        .DataKeys(keys => keys.Add(c => c.DonationID))
        .Columns(columns =>
        {
            columns.Bound(o => o.ReceivedDate).Format("{0:MM/dd/yyyy}").Width(100);
            columns.Bound(o => o.DepositDate).Format("{0:MM/dd/yyyy}").Width(90);
            columns.Bound(o => o.ContactName).Width(160);
            columns.Bound(o => o.DonationAmount).Width(115);
            columns.Bound(o => o.DonationType).Width(100);
            columns.Bound(o => o.ProjectName).Width(125);
            columns.Command(commands =>
            {
                commands.Edit().ButtonType(GridButtonType.Text);
                commands.Delete().ButtonType(GridButtonType.Text);
            }).Width(200);
        })
        .DataBinding(dataBinding =>
        {
            dataBinding.Server().Select("Edit", "Donation", new { ajax = ViewData["ajax"] });
            dataBinding.Ajax().Select("Delete", "Donation").Enabled(true)
            .Update("Edit", "Grid", new { mode = GridEditMode.InLine,type = GridButtonType.Text })
            .Delete("Delete", "Donation", new { mode = GridEditMode.InLine, type = GridButtonType.Text });
        })
                .Scrollable(scrolling => scrolling.Enabled(true))
                .Sortable(sorting => sorting.Enabled(true))
                .Pageable(paging => paging.Enabled(true))
                .Editable(editing => editing.Mode(GridEditMode.InLine))
                //.Filterable(filtering => filtering.Enabled(true))
                //.Groupable(grouping => grouping.Enabled(true))
                .Footer(true)
        )

Thank you
Tags: MVC3, ASP.NET4.0

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900