protected void grdTPAData_Sorting(object sender, GridViewSortEventArgs e)
{
if (ViewState["SORT_COLUMN"] != null)
{
if (e.SortExpression == ViewState["SORT_COLUMN"].ToString())
{
if ((SortDirection)ViewState["SORT_ORDER"] == SortDirection.Descending)
ViewState["SORT_ORDER"] = SortDirection.Ascending;
else
ViewState["SORT_ORDER"] = SortDirection.Descending;
}
else
ViewState["SORT_ORDER"] = e.SortDirection;
}
else
ViewState["SORT_ORDER"] = e.SortDirection;
ViewState["SORT_COLUMN"] = e.SortExpression;
GridDataBind();
}