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
30
WebDataGrid custom pager with batch edit
posted

We are using WebDataGrid from NetAdvantage 2011.2 for Asp.Net –bundle and embedded the custom pager described on page:

http://www.infragistics.com/products/aspnet/sample/data-grid/paging-custom-pager-template

 

The custom pager works fine when update/edit behavior is disabled. However, when we enable edit behavior (batch mode!), editing works only on first page. If the user e.g. clicks Next-button and tries to edit something on the second page, saving fails and the grid freezes. No error is displayed, but in JavaScript error console we see an error message:

SCRIPT5022: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.

 

This tells us very little, but by debugging we get the original error message from WebDataGrid: “Requested record cannot be found by key”. Debugging also revealed that when saving, finding the right page somehow fails. Most probably the grid does not remember the current page and defaults to first page. Save fails because the edited row is not on the first page.

 

Minor technical detail which might have an impact on this: After initial page load, when we click Next-button, nothing happens. When clicking again, we get the second page. By debugging we notice that the pager routine is executed twice. First outcome is that we are on first page. Then the routine is called again, and now we are not the second page. This “iterative” page changing seems to happen also during batch save.

 

Any ideas or workarounds on this? Is the combination of custom pager + batch edit supported in the first place?

Parents
  • 15979
    Suggested Answer
    posted

    Hello SharpCoder,

    The batch updating feature introduces several differences to the updating process compared to the default behavior.

    Normally when specific row is edited and then losses focus callback is made to the Server in order to update this change to the Data Source. When batch updating is enabled there is no such callback and changes are accumulated on the Client.

    When paging is used in such batch scenario the call to the Server is executed when page is changed via pager (in default pager case). Batch updating is executed by default when Postback occurs on the page or when the grid itself performs callback (on paging for example). This is shown in the following sample - http://www.infragistics.com/products/aspnet/sample/data-grid/batch-updating-events

    When custom paging is implemented such call is most probably missing and this is why batch updating does not send the data back to the Server on page change.

    Currently forsing a Postback on page change or usage of grid's default pager is recommended in such scenarios.

Reply Children
No Data