Hi,
I want to use the paging feature of asp.net ultra web grid.But I don't find any client side paging.When I use paging on grid for each new page click it makes server event/ajax event.Which is very expensive in my application.Can you tell me do I have such feature or can I implement with java script on client side.
Thanks in advance,
Shravan
WebGrid paging requires server-side processing. If the gri'ds AJAX functionality is enabled, this request is made via AJAX; otherwise, a regular postback is triggered.
Paging in WebGrid is designed to limit the data sent from the server to the client. This is why paging requires server-side processing - the information for other pages simply doesn't exist on the client. Even with EnableInternalRowsManagement set to true, these other pages are stored in ViewState, and have no other client-side presence.
Did you try following two properties to get client side paging?
ultraWebGrid.Browser = BrowserLevel.Xml; ultraWebGrid.DisplayLayout.LoadOnDemand =
ultraWebGrid.DisplayLayout.LoadOnDemand =
LoadOnDemand.Xml;
ojasmaru,
This configuration turns on the grid's AJAX functionality. When this is done, requests to change pages in the grid are still performed on the server. The difference is that the request is sent via AJAX, rather than through a postback.
Hello Vince,
I am using UltrawebGrid for the first time. After using those properties I thought the paging is happening on client side. It was after reading your post I actually placed a break point in InitializeDataSource event and realized that yes paging happens on server side. It’s just the calls are passed AJAX way.
Actually I am doing time consuming operations in InitializeDataSource event to get the data and bind it to grid. Now after your post I have realized that even InitializeDataSource is fired when I click on page numbers. How can I stop InitializeDataSource from getting fired or how can i identify that the InitializeDataSource fired due to paging and not actual loading of my grid or share point webpart.
Regards,
Ojas
Ojas,
If the time-consuming operations are necessary to getting data for the grid, you'll need to do that logic within InitializeDataSource for the grid to handle paging correctly. This is because the grid re-binds to its data source as part of changing pages.