When the user clicks on a column (to sort that column), you'll have to
handle the appropriate "sorting" event.
In the "sorting" event-handler, you need to:
- requery the data
- create a dataView from the dataset or datatable
- set the sorting on the dataview
- bind the dataview to the grid
Additionally, there are steps you need to take to set the correct up/
down arrow in the grid column header if you want a graphic to show
which column is sorted. Some people use images. Some people use
these unicode chars:▲" and "▼" to show up/down arrows. For
compatibility reasons, the images are best. I don't have the code in
front of me, but I remember being very "surprised" at how not-so-easy
this was.
|