Within my tag: <asp:DataGrid
I'm using: AllowSorting="true" and
OnSortCommand="Sort_Grid" which referrs to a method in my
Codebehind file. (see Sort_Grid below)
Since I have AutoGenerateColumns="false"
within my tag: <asp:BoundColumn
I'm using: DataField="name" SortExpression="name"
This doesn't generate an error, but when I click on the
column heading I get:
System.Web.HttpException: The View State is invalid for
this page and might be corrupted.
I do not know how to fix this problem. I am not using
any ViewState in my code. Any guidance is appreciated,
Thanks!
public void Sort_Grid(Object sender,
DataGridSortCommandEventArgs e)
{
DataView dv = new DataView(dsAccounts.Tables["account"]);
dv.Sort = e.SortExpression;
//DataGrid = dgAccounts
dgAccounts.DataSource = dv;
dgAccounts.DataBind();