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

[Solved] Problem with pagenation refresh and select

5 Answers 89 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.
Srinivas
Top achievements
Rank 1
Srinivas asked on 17 May 2012, 06:36 AM
Hi, 

Today I have installed the Telerik MVC controls and tried to do the first sample of client side selection exactly in the same way defined in the Demos. 

The grids are getting populated, But when I am tring to navigate to next page or by pressing the refresh or selecting the customers Grid I am getting the following error
"Error! The Requested Url returned 404 - not found"

Here I am attaching the screen shot of error and also the sample source code.

Please suggest me where I am doing wrong

Waiting for your quick reply.

Regards
Srinivas

5 Answers, 1 is accepted

Sort by
0
Thomas
Top achievements
Rank 1
answered on 28 May 2012, 08:37 PM
I am experiencing the very same thing. As soon as I enable "Selectable", paging, filtering, refreshing and sorting breaks. However, selections work. Weird...

Also... if I manually type in the URL the paging works. But when clicked on the buttons it doesn't, even though the URL shown on hover is correct. Please help, this is really frustrating.
0
Thomas
Top achievements
Rank 1
answered on 28 May 2012, 08:45 PM
UPDATE: When I removed .DataBinding property that just re-populates the model, all works fine... Sigh.
0
Staci
Top achievements
Rank 1
answered on 18 Jul 2012, 12:26 PM
Thomas, are you able to post your View so I can see what you did as I can't get paging to work.

Cheers
0
Thomas
Top achievements
Rank 1
answered on 18 Jul 2012, 12:56 PM
I can't post the entire view as I work for a corporation and this is internal use only. 

For sorting and filtering be sure you have no NULL data in columns containing strings. (Telerik should deal with that out of the box but it isn't a big issue to work around)

For pagination you have to have DataBinding correctly configured. Here is an example of one of my grids that deals with member search form:

<%:
Html.Telerik().Grid<spMember_SearchMembers_Result>()
.Name("MemberGrid")
.DataKeys(keys => keys.Add(m => m.MemberNumber).RouteKey("MemberNumber"))
.Columns(columns =>
{
 columns.Bound(c => c.MemberNumber).Width(105).Title("Member No").HeaderHtmlAttributes(new { @title = "Sort or Filter based on membership number" });
 columns.Bound(c => c.Barcode).Width(110).Title("Barcode").HeaderHtmlAttributes(new { @title = "Sort or Filter based on barcode" });
 columns.Bound(c => c.RFID).Width(110).Title("RFID").HeaderHtmlAttributes(new { @title = "Sort or Filter based on RFID code" });
 columns.Bound(c => c.ClubNumber).Width(69).Title("Club").HeaderHtmlAttributes(new { @title = "Sort or Filter based on club number" });
 columns.Bound(c => c.MemberFirstName).Width(135).Title("First Name").HeaderHtmlAttributes(new { @title = "Sort or Filter based on first name" });
 columns.Bound(c => c.MemberLastName).Width(140).Title("Last Name").HeaderHtmlAttributes(new { @title = "Sort or Filter based on last name" });
 columns.Bound(c => c.TelephoneNumber).Width(110).Title("Phone").HeaderHtmlAttributes(new { @title = "Sort or Filter based on phone number" });
 columns.Bound(c => c.MemberStatus).Width(200).Title("Status").HeaderHtmlAttributes(new {@title = "Sort or Filter based on member status"});
 columns.Bound(c => c.Address1).Width(250).Title("Address").HeaderHtmlAttributes(new { @title = "Sort or Filter based on street address" });
 columns.Bound(c => c.Address2).Width(200).Title("City").HeaderHtmlAttributes(new { @title = "Sort or Filter based on city" });
 columns.Bound(c => c.Province).Width(69).Title("Prov").HeaderHtmlAttributes(new { @title = "Sort or Filter based on province" });
 columns.Bound(c => c.ClubName).Hidden(true).Title("ClubName");
 columns.Bound(c => c.PaymentAmt).Hidden(true);
 columns.Bound(c => c.PaymentSchedule).Hidden(true);
 columns.Bound(c => c.MemberSince).Format("{0:dddd, MMM d, yyyy}").Hidden(true);
 columns.Bound(c => c.TotalOutstanding).Hidden(true);
 columns.Bound(c => c.DisplayExtendedMemberInformation).Hidden(true);
 columns.Bound(c => c.MemberDetailStatusMsgCode).Hidden(true);
})
.DataBinding(dataBinding => dataBinding.Ajax().OperationMode(GridOperationMode.Client).Select("SelectionClientSideMembers", "MemberManagement"))
.Pageable(pagerAction => pagerAction.PageSize(10))
.KeyboardNavigation()
.Filterable()
.Sortable(sorting => sorting.SortMode(GridSortMode.MultipleColumn))
.Selectable()
.Scrollable(scrolling => scrolling.Height(250))
.Reorderable(reorder => reorder.Columns(false))
.ClientEvents(events => events.OnRowSelect("onRowSelected").OnDataBinding("onMemberGridDataBinding").OnDataBound("onMemberGridDataBound").OnError("onMemberGridError"))
.HtmlAttributes(new { @class = "MemberSearchResultsGrid noprint" })
%>

Hope this helps a bit. Note I chose GridOperationMode.Client to prevent DB hit each time someone paginates etc.
0
Staci
Top achievements
Rank 1
answered on 18 Jul 2012, 01:04 PM
This is great thanks, you have helped me - I really appreciate it!
Tags
Grid
Asked by
Srinivas
Top achievements
Rank 1
Answers by
Thomas
Top achievements
Rank 1
Staci
Top achievements
Rank 1
Share this question
or