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

[Solved] MVC Grid paging goes crazy

0 Answers 76 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Eric
Top achievements
Rank 1
Eric asked on 23 Oct 2012, 03:17 PM
In the example below if I set the clientid = 0 to return an empty grid when the page opens the 
grid paging goes haywire after I do an actual search. It either does not respond at all or it shows
no pages and the total and current span and total shows jibberish and the links don't work.

I cannot allow the grid to do an Initial search, it takes too long.

However if the grid is populated when it opens then everything is fine but the search with default form values
takes 10 seconds. Far too long.

I need the grid to open empty and stop going nuts when I do a large search after the grid is rendered.

I have already had to hack around the fact that the busy indicator stops working when you open an empty grid.

@(Html.Telerik().Grid(Model.MemberSearchResultList)
    .Name("Members")
    .TableHtmlAttributes(new { @class = "dataGridTable" })
    .Columns(columns =>
        {
            columns.Bound(theMember => theMember.DisplayName).HeaderTemplate("Name");
            columns.Bound(theMember => theMember.MemberId);
            columns.Bound(theMember => theMember.ClientMemberId).HeaderTemplate("Health Plan ID");
            columns.Bound(theMember => theMember.DateOfBirth).HeaderTemplate("DOB").Format("{0:M/d/yyyy}");
            columns.Bound(theMember => theMember.Address);
            columns.Bound(theMember => theMember.Campaign);
            columns.Bound(theMember => theMember.ClientID).Hidden(true);
            columns.Bound(theMember => theMember.CampaignID).Hidden(true);
        })
     .EnableCustomBinding(true)
         .DataBinding(dataBinding => dataBinding.Ajax().Select("DoMemberSearch", "Members", new { ClientId = Model.ClientSelectList.SelectedValue, CampaignID = Model.CampaignSelectList.SelectedValue, MemberId = Model.MemberId, MMDMId = Model.MMDMSelectList.SelectedValue, ClientMemberId = Model.ClientMemberId }))    
     .Pageable(pager => pager.Total(Model.TotalRecords).PageSize(10)).Selectable()
     .ClientEvents(events => events.OnRowSelect("handleGridRowSelected").OnDataBinding("handleDataBinding").OnError("handleAjaxErrorFromGrid"))
)
Tags
General Discussions
Asked by
Eric
Top achievements
Rank 1
Share this question
or