Exemple #1
0
        private void dgRequiringScan_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            Facade.IPCV facPCV          = new Facade.PCV();
            DataSet     dsRequiringScan = facPCV.GetRequiringScan();

            //' Retrieve the data source from session state.
            DataTable dt = dsRequiringScan.Tables[0];

            //' Create a DataView from the DataTable.
            DataView dv = new DataView(dt);

            //' The DataView provides an easy way to sort. Simply set the
            //' Sort property with the name of the field to sort by.
            if (this.SortCriteria == e.SortExpression)
            {
                if (this.SortDir == "desc")
                {
                    this.SortDir = "asc";
                }
                else
                {
                    this.SortDir = "desc";
                }
            }

            this.SortCriteria = e.SortExpression;

            dv.Sort = e.SortExpression + ' ' + this.SortDir;

            //' Re-bind the data source and specify that it should be sorted
            //' by the field specified in the SortExpression property.
            dgRequiringScan.DataSource = dv;
            dgRequiringScan.DataBind();
        }
Exemple #2
0
        private void PopulateRequiringScan()
        {
            Facade.IPCV facPCV          = new Facade.PCV();
            DataSet     dsRequiringScan = facPCV.GetRequiringScan();

            dgRequiringScan.DataSource = dsRequiringScan;
            dgRequiringScan.DataBind();
        }