Esempio n. 1
0
        /// <summary>
        /// Maintain sort on data source and rebind.
        /// </summary>
        /// <param name="direction">The direction of the sort.</param>
        private void SortGridView(String direction)
        {
            // Get current data source as datatable and define a view.
            DataTable dt = HList.ToDataTable <Blob>(this.BlobFileList);
            DataView  dv = new DataView(dt);

            if (!String.IsNullOrEmpty(this.GridViewSortExpression))
            {
                // If necessary, sort data source based on sort expression.
                dv.Sort = this.GridViewSortExpression + direction;
            }

            // Rebind file list.
            this.gvUploads.DataSource = dv;
            this.gvUploads.DataBind();
        }