I have custom some controls residing in SharepPoint webparts. I use a GridView control to take advantage of the built-in paging and column sort. The GridView gets databound from a method that iterates through an SPlist
(with a foreach
loop) to build a DataTable. This looping through the list is required to apply logic to process the list prior to display in the grid.
As the list get bigger, the page takes longer (forever) to load. Even though the paging permits the GridView to display only 12 rows of data, I believe the foreach
loop is processing the entire list.
I've done server-side paging in .Net with both SQL and nHibernate. It should be possible to do this in SharePoint, right?. I am looking for some guidence, sample code, or any type of direction. Even a definitive "you're an idiot" would help.
Anyone done this before? Or, does anyone have an alternative databind scheam that they could suggest?
Thanks.