G
Guest
I'm getting an error in the following scenario.
- A GridView control is bound to an SQLDataSource.
- The user selects a column for sorting.
- Some time later in code the column used for sorting is removed and the
SelectCommand SQL changed so that the field is not returned.
- When the GridView is redisplayed an error occurs because the
GridView.SortExpression is no longer a valid column.
The SortExpression property of the GridView control is read only so it can't
be set to null or changed.
My question is how can I implement this behaviour without the error occuring?
James
- A GridView control is bound to an SQLDataSource.
- The user selects a column for sorting.
- Some time later in code the column used for sorting is removed and the
SelectCommand SQL changed so that the field is not returned.
- When the GridView is redisplayed an error occurs because the
GridView.SortExpression is no longer a valid column.
The SortExpression property of the GridView control is read only so it can't
be set to null or changed.
My question is how can I implement this behaviour without the error occuring?
James