I finally managed to create a solution with all the bells whistling and sort… as far as I know.
The Visual Studio 2008 solution can de found here.
The SQL database can be found here.
Attach the database in SQL. If you find any problems or have any questions, please leave a comment or send me a mail.
For this solution to work, you need to have added the AJAX-entries to the web.config of your MOSS2007 with SP1 installation, as well as the infrastructure-update.
Compile and add the compiled DLL’s to the BIN-directory of your site. By default, the Debug-version automatically gets compiled to the path “C:\inetpub\wwwroot\wss\VirtualDirectories\80\bin”.
Then, add the correct entries in web.config (SafeControls and Assemblies), then, add the WebParts (DevTinkeringParents en DevTinkeringChilds) to the WebPart-gallery and put them in a WebPart-zone on a page of your liking.
You also need to have Visual Studio enhancements for WSS 1.3 installed, because the WebParts are based on the SharePoint WebPart-template.
Ok, seems like I found out where things go wrong about losing filtering when sorting…
I’ve disabled the ViewState for the SPGridView, because when a user refreshes his browser after working with things for a while and just returned from a detailsview of entered the detailsview from the gridview, the error “Failed to load ViewState” appears.
This can be solved by disabling the viewstate for the gridview and/or detailsview (depending on what you want to prevent).
So now I have to find a way to handle this nicely…
Oh, by the way… when I get things sorted out, somewhat, I will post a VS2008 solution with database, so you can see the ‘final thing’…
Ok, so I’ve hit one more snag…
When a filter has been set, and a column is clicked to sort, the filter gets lost.
When an SPGridView sorts, it has an empty FilterFieldName.
So, we have to see if we can store this somewhere.
To be continued…
I came across some very nice articles when browsing the internet for some information on how to enable filtering and sorting an an SPGridView with a LinqDataSource as datasource. The most usefull one I found is this one from Johan Leino.
However, there are still some things to be done. Read more…