Posted on 2007-07-30
SQL question: Suppose I have a datagrid with email messages... I use a simple sql statement such as select * from Messages where id = 5; or something like that. Then suppose I have at the leftmost column checkboxes that indicate something like messages marked for deletion. Now you have a datagrid with messages, some marked, some not marked. Now suppose on the leftmost column, I then wanted to create a sorting mechanism - where you can sort the rows that are checked and make them show up at the top. This is basically what I'm trying to do.
I have the IDs of the rows that are marked, but because the datagrid spans many pages I want the user to be able to sort by everything he selected (the ones selected are in a session variable) - any idea how to sort them without having to resort to using asp.net DataTable, DataRow, etc. functionalities? I would definitely rather do this by SQL than by chopping up the datagrid via C# and putting it back together again.
Any ideas? Thanks so much in advance!