- protected void grdVw_FileList_Sorting(object sender, GridViewSortEventArgs e)
- {
- GridSorting(e.SortExpression, grdVw_FileList);
- }
- private void GridSorting(string column, GridView grid)
- {
- // Session["column"] = ""; clear this after ever search/load
- string column_ASC = column + " ASC";
- string column_DESC = column + " DESC";
- DataTable dt = (DataTable)Session["fileList"];
- if (Session["column"].ToString().ToUpper() == column_ASC.ToUpper())
- {
- grid.DataSource = dv;
- grid.DataBind();
- Session["column"] = column_DESC;
- }
- else
- {
- grid.DataSource = dv;
- grid.DataBind();
- Session["column"] = column_ASC;
- }
- }
Wednesday, 7 July 2010
SORTING GRIDVIEW CONTROL ASP.NET
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment