I am using a gridview object on my page to display any number of reports and formats based on user-selected options. A user might run several different report formats on a single visit to the page. The gridview allows autosorting.
If the user sorts on a field, then later switches to a report format that does not contain that same field name, the following error message is raised at System.Data.DataTable.ParseSortString(String sortString) on the the grid binds:
Source: System.Data, Cannot find column columnname
This is happening on the databind method for the gridview after a new SelectCommand is fed to the dataSource. I can test the sortExpression for the gridview prior to binding, but it is a read only property. In short, I have a new dataset being fed to the gridView, but relic of a prior sort, that I can not seem to rid myself of, is causing my bind to fail.
Switching between report views works fine if no user sorting has been done or it has been done on a field that is common between the first and second report formats.
Any suggestions appreciated!