This is a migrated thread and some comments may be shown as answers.

[Solved] Telerik grid Paging is not Working

1 Answer 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
M Ali
Top achievements
Rank 2
M Ali asked on 14 Jun 2012, 06:21 PM

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.

@(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("FirstLook", "Grid", new { ajax = ViewData["ajax"] });
            dataBinding.Ajax().Select("_FirstLook", "Grid").Enabled(true)
            .Update("Edit", "Grid", new { mode = GridEditMode.InLine,type = GridButtonType.Text })
            .Delete("Delete", "Grid", 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

1 Answer, 1 is accepted

Sort by
0
M Ali
Top achievements
Rank 2
answered on 15 Jun 2012, 12:34 PM
Finally got it I just comment out following line 
dataBinding.Server().Select("FirstLook", "Grid", new { ajax = ViewData["ajax"] });
and It Works 
Thank you 
Tags
Grid
Asked by
M Ali
Top achievements
Rank 2
Answers by
M Ali
Top achievements
Rank 2
Share this question
or