I have an ASP.NET application that displays various views into a largish database of protein sequences. As a visitor browses the data, I'd like for them to be able to select a CheckBox in the GridView row to flag sequences for later download as a zipped text file. I don't want to store the selections so they should just be valid for the session.
My idea right now is to add a TemplateField to the GridView and then add a CheckBox to that. I intend to handle the check events and store the sequence IDs in the session state. When the user heads to the download page I'll get the session data, display the list of sequences they are about to download and then send the file along. Obviously I'll also have to reparse the session data on every form load / page switch.
So I actually have a couple of questions about this:
1) Am I doing too much work? Is there an easier way to implement this?
2) Are all the round trips to the server for the session state likely to be a performance problem? I can put a "Save for Download" button on the page to batch it to help things. Handling the check events just seems more error tolerant since you can't accidentally lose your state if you navigate away.
3) Is it possible to sort the GridView by the checked box column? I'd like to sort by the checked box column first then the currently sorted column (e.g. If the GridView is sorted by last name, sorting by the check column and then by last name).
In case it matters, I'm using C#, .NET 3.5, VS2008 and I'm using the simple drag-n-drop way of creating a GridView from a SQLServerExpress table.