protected void Sort_Grid(Object sender, DataGridSortCommandEventArgs e)
 {
     DataView dv = new DataView(buildGridData());
     dv.Sort = e.SortExpression.ToString();
     DataGrid1.DataSource = dv;
     DataGrid1.DataBind();
 }
Esempio n. 2
0
        //The SortCommand event handler
        public void Announcements_SortCommand(object sender, DataGridSortCommandEventArgs e)
        {
            //Toggle SortAscending if the column that the data was sorted by has
            //been clicked again...
            if (lbOrderBy.Text == e.SortExpression)
            {
                if (lbDesc.Text == "desc")
                {
                    lbDesc.Text = "";
                    lblCurrentSort.Text = "ASC";
                    lbsort.Text = e.SortExpression;
                }
                else
                {
                    lbDesc.Text = "desc";
                    lblCurrentSort.Text = "DESC";
                    lbsort.Text = e.SortExpression;
                }
            }
            else
            {
                lbOrderBy.Text = e.SortExpression;
                lbDesc.Text = "";
                lblCurrentSort.Text = "ASC";
                lbsort.Text = e.SortExpression;
            }

            BindData();
            //rebind the DataGrid data
        }
 protected void Sort_Grid(Object sender, DataGridSortCommandEventArgs e)
 {
     DataView dv = new DataView(Posts.GetPostTableList());
     dv.Sort = e.SortExpression.ToString();
     DataGrid1.DataSource = dv;
     DataGrid1.DataBind();
 }
 protected void articleList_SortCommand(object source, DataGridSortCommandEventArgs e)
 {
     FileInfo[] DataFiles = null;
     DataFiles = CarregarListaArquivos();
     SortFiles(ref DataFiles, e.SortExpression);
     articleList.DataSource = DataFiles;
     articleList.DataBind();
 }
 protected void dgarquivo_SortCommand(object source, DataGridSortCommandEventArgs e)
 {
     DataTable dtFiles = null;
     dtFiles = CarregarLogArquivo(hid_arquivo.Value);
     SortFiles(ref dtFiles, e.SortExpression);
     dgarquivo.DataSource = dtFiles;
     dgarquivo.DataBind();
 }
Esempio n. 6
0
 protected void grdMain_SortCommand(object source, DataGridSortCommandEventArgs e)
 {
     if ((pc["ArticleListMain_Sort"] != null) && (pc["ArticleListMain_Sort"].ToString() == (string)e.SortExpression))
     pc["ArticleListMain_Sort"] = (string)e.SortExpression + " DESC";
       else
     pc["ArticleListMain_Sort"] = (string)e.SortExpression;
       pc["ArticleListMain_CurrentPage"] = "0";
       Response.Redirect("../Incidents/ArticleListMain.aspx");
 }
Esempio n. 7
0
 protected void grdMain_SortCommand(object source, DataGridSortCommandEventArgs e)
 {
     if (ViewState["SelectIssue_Sort"].ToString() == e.SortExpression)
         ViewState["SelectIssue_Sort"] += " DESC";
     else
         ViewState["SelectIssue_Sort"] = e.SortExpression;
     ViewState["SelectIssue_CurrentPage"] = 0;
     BindGrid();
 }
Esempio n. 8
0
 private void dgList_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
     try
     {
         BLL.GridSort.SortCommand((DataGrid)source, ViewState, source, e);
         ((DataGrid)source).CurrentPageIndex = 0;
         BuildSearchString();
         LoadDataGrid();
     }
     catch (Exception ex)
     {
         ApplicationLog.WriteLog(this.ToString(), ex, "");
         Response.Write(Rms.Web.JavaScript.Alert(true, "初始化页面出错:" + ex.Message));
     }
 }
        protected void SortTeams_Click(object sender, DataGridSortCommandEventArgs e)
        {
            if (ViewState["SortExpression"] != null && ViewState["SortExpression"].ToString() == e.SortExpression)
            {
                ViewState["SortAscending"] = !(bool) ViewState["SortAscending"];
            }
            else
            {
                ViewState["SortAscending"] = true;
            }

            ViewState["SortExpression"] = e.SortExpression;

            SortTeams();
        }
Esempio n. 10
0
        protected void grdApprover_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            if (strSortOrder == "ASC")
            {
                strSortOrder = "DESC";
            }
            else
            {
                strSortOrder = "ASC";
            }

            strSortField = e.SortExpression;
            GetDataGridValues(System.Convert.ToInt32(ddlCompany.SelectedValue), 0, "", 0, 0);
            GetAllCategoryByAdmin();
        }
Esempio n. 11
0
        protected void GridActivities_SortCommand(object source, DataGridSortCommandEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            if (pc[keySort] == e.SortExpression)
                pc[keySort] += " DESC";
            else
                pc[keySort] = e.SortExpression;

            ViewState[keyPage] = 0;
            BindGrid();
        }
Esempio n. 12
0
        private void dgJogos_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            if (!this.SortExpression.ToLower().StartsWith(e.SortExpression.ToLower()))
            {
                this.SortExpression = e.SortExpression + " asc";
            }
            else if (this.SortExpression.ToLower().EndsWith(" asc"))
            {
                this.SortExpression = this.SortExpression.Replace(" asc", " desc");
            }
            else
            {
                this.SortExpression = this.SortExpression.Replace(" desc", " asc");
            }

            this.CarregarJogos();
        }
Esempio n. 13
0
        // Invoked when a column sort label is clicked.
        private void OnSortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            string newSortColumn = e.SortExpression;

            if (newSortColumn == this.Sort)
            {
                SwapDirection();
            }
            else
            {
                this.SortDirection = "Asc";
            }

            gridUser.CurrentPageIndex = 0;
            this.Sort = e.SortExpression;
            BindGrid(-1);
        }
Esempio n. 14
0
        public void OrdinaDataGrid(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            string verso = "";

            if (Convert.ToString(ViewState["verso"]) == "" || Convert.ToString(ViewState["verso"]) == "DESC")
            {
                verso = "ASC";
                ViewState["verso"] = verso;
            }
            else
            if (Convert.ToString(ViewState["verso"]) == "ASC")
            {
                verso = "DESC";
                ViewState["verso"] = verso;
            }
            ViewState["campoDiOrdinamento"] = e.SortExpression + " " + verso;
        }
Esempio n. 15
0
        private void dgJob_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            DataView dvJob = new DataView(dsJob.Tables[0]);

            if (sortDirection == "desc")
            {
                dvJob.Sort    = e.SortExpression + " desc ";
                sortDirection = (string)ViewState["asc"];
            }
            else
            {
                dvJob.Sort    = e.SortExpression;
                sortDirection = (string)ViewState["desc"];
            }
            dgJob.DataSource = dvJob;
            dgJob.DataBind();
        }
        /// <summary>
        /// Procedura permite sortarea datelor pe coloane
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        private void listDataGrid_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            // Retrieve the data source from session state.
            DataSet dt = (DataSet)Session["DataSource_Contract"];

            // Create a DataView from the DataTable.
            DataView dv = dt.Tables[0].DefaultView;

            // The DataView provides an easy way to sort. Simply set the
            // Sort property with the name of the field to sort by.
            dv.Sort           = e.SortExpression;
            Session["SortBy"] = e.SortExpression;
            // Rebind the data source
            listDataGrid.DataSource = dv;
            Index = (listDataGrid.CurrentPageIndex * listDataGrid.PageSize) + 1;
            listDataGrid.DataBind();
        }
        protected void articleList_SortCommand(object source, DataGridSortCommandEventArgs e)
        {
            FileInfo[] DataFiles = null;
            if (Session["DataFiles"]==null)
            {
                DataFiles = CarregarListaArquivos(ddlambiente.Text, ddlsistema.Text);
                Session["DataFiles"] = DataFiles;
            }
            else
            {
                DataFiles = (FileInfo[]) Session["DataFiles"];
            }

            SortFiles(ref DataFiles, e.SortExpression);
            articleList.DataSource = DataFiles;
            articleList.DataBind();
        }
Esempio n. 18
0
        protected void dbStaffList_SortCommand(object source, DataGridSortCommandEventArgs e)
        {
            if (ViewState["sortfield"] == null)
            {
                ViewState["sortfield"] = e.SortExpression;
                ViewState["sortdirect"] = "ASC";
            }
            else
            {
                if (ViewState["sortfield"].ToString() == e.SortExpression)
                {
                    ViewState["sortdirect"] = (ViewState["sortdirect"].ToString() == "ASC" ? "DESC" : "ASC");
                }
                else
                {
                    ViewState["sortfield"] = e.SortExpression;
                    ViewState["sortdirect"] = "ASC";
                }
            }

            foreach (DataGridColumn col in dbStaffList.Columns)
            {
                if (col.SortExpression.ToString() == ViewState["sortfield"].ToString())
                {
                    if (ViewState["sortdirect"].ToString() == "ASC")
                    {
                        col.HeaderText += "<img src='../../images/asc.gif' border=0/>";
                        col.HeaderText = col.HeaderText.Remove(col.HeaderText.IndexOf('<'));
                        col.HeaderText += "<img src='../../images/asc.gif' border=0/>";
                    }
                    else
                    {
                        col.HeaderText += "<img src='../../images/desc.gif' border=0/>";
                        col.HeaderText = col.HeaderText.Remove(col.HeaderText.IndexOf('<'));
                        col.HeaderText += "<img src='../../images/desc.gif' border=0/>";
                    }
                }
                else
                {
                    col.HeaderText += "<img src='../../images/desc.gif' border=0/>";
                    col.HeaderText = col.HeaderText.Remove(col.HeaderText.IndexOf('<'));

                }
            }
            BindGrid();
        }
Esempio n. 19
0
 /// <summary>
 /// ��������
 /// </summary>
 /// <param name="SB"></param>
 /// <param name="e"></param>
 public void SetSort(System.Web.UI.StateBag SB, DataGridSortCommandEventArgs e)
 {
     if (SB["sort"] == null)
     {
         SB["sort"] = e.SortExpression;
         SB["desc"] = "";
     }
     else if ((SB["sort"].ToString() + SB["desc"].ToString()).ToString() == e.SortExpression)
     {
         SB["sort"] = e.SortExpression;
         SB["desc"] = " DESC";
     }
     else
     {
         SB["sort"] = e.SortExpression;
         SB["desc"] = "";
     }
 }
Esempio n. 20
0
        private void dgResellers_Sort(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            String strSortBy        = (String)ViewState["SortExpression"];
            String strSortAscending = (String)ViewState["SortAscending"];

            ViewState["SortExpression"] = e.SortExpression;

            if (e.SortExpression == strSortBy)
            {
                ViewState["SortAscending"] = (strSortAscending == "yes"
                                        ? "no" :"yes");
            }
            else
            {
                ViewState["SortAscending"] = "yes";
            }

            BindDGResellers();
        }
Esempio n. 21
0
		private void DataGridCount_SortCommand (object source , System.Web.UI.WebControls.DataGridSortCommandEventArgs e )
		{
			//获得列名
			//string sColName = e.SortExpression ;

			string ImgDown = "<img border=0 src=" + Request.ApplicationPath + "/Images/uparrow.gif>";
			string ImgUp = "<img border=0 src=" + Request.ApplicationPath + "/Images/downarrow.gif>";
			string SortExpression = e.SortExpression.ToString();
			string SortDirection = "ASC";
			int colindex = -1;
			//清空之前的图标
			for (int i = 0; i < DataGridCount.Columns.Count; i++)
			{
				DataGridCount.Columns[i].HeaderText = (DataGridCount.Columns[i].HeaderText).ToString().Replace(ImgDown, "");
				DataGridCount.Columns[i].HeaderText = (DataGridCount.Columns[i].HeaderText).ToString().Replace(ImgUp, "");
			}
			//找到所点击的HeaderText的索引号
			for (int i = 0; i < DataGridCount.Columns.Count; i++)
			{
				if (DataGridCount.Columns[i].SortExpression == e.SortExpression)
				{
					colindex = i;
					break;
				}
			}
			if (SortExpression == DataGridCount.Attributes["SortExpression"])
			{
 
				SortDirection = (DataGridCount.Attributes["SortDirection"].ToString() == SortDirection ? "DESC" : "ASC");
 
			}
			DataGridCount.Attributes["SortExpression"] = SortExpression;
			DataGridCount.Attributes["SortDirection"] = SortDirection;
			if (DataGridCount.Attributes["SortDirection"] == "ASC")
			{
				DataGridCount.Columns[colindex].HeaderText = DataGridCount.Columns[colindex].HeaderText + ImgDown;
			}
			else
			{
				DataGridCount.Columns[colindex].HeaderText = DataGridCount.Columns[colindex].HeaderText + ImgUp;
			}
			ShowData(strSql);
		}
 private void SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
     if (e.SortExpression != Convert.ToString(Session["sort_field"]))
     {
         Session["sort_field"]     = e.SortExpression;
         Session["sort_direction"] = "ASC";
     }
     else
     {
         if (Convert.ToString(Session["sort_direction"]) == "ASC")
         {
             Session["sort_direction"] = "DESC";
         }
         else
         {
             Session["sort_direction"] = "ASC";
         }
     }
     DG_bind();
 }
        protected void GridItemList_SortCommand(object source, DataGridSortCommandEventArgs e)
        {
            string sortingDirection = string.Empty;
            if (sortProperty == SortDirection.Ascending)
            {
                sortProperty = SortDirection.Descending;
                sortingDirection = "Desc";
            }
            else
            {
                sortProperty = SortDirection.Ascending;
                sortingDirection = "Asc";
            }

            DataTable dataTable = Session["CatGroupList"] as DataTable;
            DataView sortedView = new DataView(dataTable);
            sortedView.Sort = e.SortExpression + " " + sortingDirection;
            GridItemList.DataSource = sortedView;
            GridItemList.DataBind();
        }
 private void SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
     if (e.SortExpression != curr_SortField)
     {
         curr_SortField     = e.SortExpression;
         curr_SortDirection = "ASC";
     }
     else
     {
         if (curr_SortDirection == "ASC")
         {
             curr_SortDirection = "DESC";
         }
         else
         {
             curr_SortDirection = "ASC";
         }
     }
     DG_bind(DDLtixing.SelectedValue, ddlselectedvalue, curr_SortField + " " + curr_SortDirection);
 }
 private void SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
     if (e.SortExpression == sort_field)
     {
         if (sort_direction == "ASC")
         {
             sort_direction = "DESC";
         }
         else
         {
             sort_direction = "ASC";
         }
     }
     else
     {
         sort_field     = e.SortExpression;
         sort_direction = "ASC";
     }
     DG_bind();
 }
Esempio n. 26
0
 //工作项排序
 private void dgTask_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
     try
     {
         DataView dv = (DataView)this.dgTask.DataSource;
         if (dv.Sort.IndexOf("DESC") < 0)
         {
             dv.Sort = e.SortExpression + " DESC";
         }
         else
         {
             dv.Sort = e.SortExpression + " ASC";
         }
         this.dgTask.DataSource = dv;
         this.dgTask.DataBind();
     }
     catch (Exception ex)
     {
         ApplicationLog.WriteLog(this.ToString(), ex, "载入我的工作失败");
     }
 }
Esempio n. 27
0
        private void dgList_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            string oldSortColumn = (string)this.ViewState["SortColumn"];
            string oldSortASC    = (string)this.ViewState["SortASC"];

            if (e.SortExpression == oldSortColumn)
            {
                if (oldSortASC == "True")
                {
                    this.ViewState.Add("SortASC", "False");
                }
                else
                {
                    this.ViewState.Add("SortASC", "True");
                }
            }
            this.ViewState.Add("SortColumn", e.SortExpression);

            BuildSqlString();
            LoadDataGrid();
        }
        private void grdSearchResults_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            string attrFilterDef    = (string)ViewState["AttributesFilter"];
            string contextFilterDef = (string)ViewState["ContextFilter"];
            int    recStart         = grdSearchResults.CurrentPageIndex * grdSearchResults.PageSize;
            int    recNumber        = grdSearchResults.PageSize;
            string orderByAttribute = e.SortExpression;

            ViewState["OrderByAttribute"] = e.SortExpression;
            OrderByAttribute = e.SortExpression;

            DocLinkUrl_Begin = (string)ViewState["DocLinkUrl_Begin"];
            DocLinkUrl_End   = (string)ViewState["DocLinkUrl_End"];


            try
            {
                DocSearch search = new DocSearch();
                if (search.Find(attrFilterDef.ToString(), contextFilterDef, orderByAttribute, recStart, recNumber))
                {
                    //grdSearchResults.CurrentPageIndex = e.NewPageIndex;
                    grdSearchResults.DataSource       = search.ResultSet;
                    grdSearchResults.VirtualItemCount = search.VirtualCount;
                    grdSearchResults.DataBind();
                    grdSearchResults.Visible = true;
                }
                else
                {
                    grdSearchResults.Visible = false;
                }

                UpdateResultInfo(search);
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }
Esempio n. 29
0
        protected void dgdKeys_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            DataSet  dsKeys = GetKeyData();
            DataView dv     = new DataView(dsKeys.Tables[0]);

            if (this.VehicleKeySortCriteria == e.SortExpression)
            {
                if (this.VehicleKeySortDirection == "desc")
                {
                    this.VehicleKeySortDirection = "asc";
                }
                else
                {
                    this.VehicleKeySortDirection = "desc";
                }
            }

            this.VehicleKeySortCriteria = e.SortExpression;

            dv.Sort            = e.SortExpression + ' ' + this.VehicleKeySortDirection;
            dgdKeys.DataSource = dv;
            dgdKeys.DataBind();
        }
Esempio n. 30
0
        private void dgrd_StaffList_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            if (ViewState["sortfield"] == null)
            {
                ViewState["sortfield"]  = e.SortExpression;
                ViewState["sortdirect"] = "ASC";
            }
            else
            {
                if (ViewState["sortfield"].ToString() == e.SortExpression)
                {
                    ViewState["sortdirect"] = (ViewState["sortdirect"].ToString() == "ASC"?"DESC":"ASC");
                }
                else
                {
                    ViewState["sortfield"]  = e.SortExpression;
                    ViewState["sortdirect"] = "ASC";
                }
            }

            foreach (DataGridColumn col in  dgrd_StaffList.Columns)
            {
                if (col.SortExpression.ToString() == ViewState["sortfield"].ToString())
                {
                    if (ViewState["sortdirect"].ToString() == "ASC")
                    {
                        col.HeaderText += "<img src='../../../images/asc.gif' border=0/>";
                    }
                    else
                    {
                        col.HeaderText += "<img src='../../../images/desc.gif' border=0/>";
                    }
                }
            }

            BindGrid(staffname, positionid, mobile, email, gender, displayfieldsid);
        }
Esempio n. 31
0
        private void dgList_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            dgList.CurrentPageIndex = 0;

            string s1 = (string)Session["SortExpression"];
            string s2 = e.SortExpression;

            if (s1 != null && s1.EndsWith("desc"))
            {
                s1 = s1.Substring(0, s1.Length - 5);
            }
            if (s2 != null && s2.EndsWith("desc"))
            {
                s2 = s2.Substring(0, s2.Length - 5);
            }

            // if click on the same field , swtich asc/desc
            if (s1 == s2)
            {
                s1 = (string)Session["SortExpression"];
                if (s1.EndsWith("desc"))
                {
                    s1 = s1.Substring(0, s1.Length - 5);
                }
                else
                {
                    s1 += " desc";
                }
                Session["SortExpression"] = s1;
            }
            else
            {
                //else using the default sort expression
                Session["SortExpression"] = e.SortExpression;
            }
            Bind();
        }
Esempio n. 32
0
        protected void dgGroups_SortCommand(object source, DataGridSortCommandEventArgs e)
        {
            if (e.SortExpression.Length != 0)
            {
                if (e.SortExpression == SortField.ToString())
                {
                    SortAsc = !SortAsc;
                }

                SortField = (Group.eSortColumn) Enum.Parse(typeof(Group.eSortColumn), e.SortExpression);
            }

            performSearch();
        }
Esempio n. 33
0
 private void dgAvailableFields_SortCommand(object source, DataGridSortCommandEventArgs e)
 {
     if ((_pc["Cust_AvailableFields_Sort"] != null) && (_pc["Cust_AvailableFields_Sort"] == e.SortExpression))
         _pc["Cust_AvailableFields_Sort"] += " DESC";
     else
         _pc["Cust_AvailableFields_Sort"] = e.SortExpression;
     BindAvailableFields();
 }
Esempio n. 34
0
 protected void InvoicesDataGrid_Sort(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
 }
 protected void Datagrid2_SortCommand(object source, DataGridSortCommandEventArgs e)
 {
     oListPage2.PrepareForSortCommand(e.SortExpression);
     this.RefreshGrid2();
 }
Esempio n. 36
0
 protected void Sort_Grid(Object sender, DataGridSortCommandEventArgs e)
 {
     DataGrid1.Sort = e.SortExpression.ToString();
 }
Esempio n. 37
0
        private void dgUsers_SortCommand(object source, DataGridSortCommandEventArgs e)
        {
            if (e.SortExpression.Length != 0)
            {
                if (e.SortExpression == SortField)
                {
                    SortAsc = !SortAsc;
                }

                SortField = e.SortExpression;
            }

            PerformSearch();
        }
Esempio n. 38
0
        //*********************************************************************
        //
        // The ProjectGrid_Sort event handler changes the sortfield for the Projects grid
        // and re-binds it.
        //
        //*********************************************************************

        private void UsersGrid_Sort(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            SortField = e.SortExpression;
            BindUsers();
        }
Esempio n. 39
0
 private void mlDGWORKSHEET_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
     SortingDataGrid(e.SortExpression, Convert.ToInt32(mlDDLPAGESIZE.SelectedItem.Text));
 }
        protected void dgVideoUploads_SortCommand(object source, DataGridSortCommandEventArgs e)
        {
            if (e.SortExpression.Length != 0)
            {
                if (e.SortExpression == ((int) SortField).ToString())
                {
                    SortAsc = !SortAsc;
                }

                SortField = (VideoUploadsSearch.eSortColumn) Convert.ToInt32(e.SortExpression);
            }

            performSearch();
        }
		public void Events ()
		{
			DataGridPoker p = new DataGridPoker ();
			DataGridCommandEventArgs command_args = new DataGridCommandEventArgs (null,
					null, new CommandEventArgs (String.Empty, String.Empty));
			DataGridItemEventArgs item_args = new DataGridItemEventArgs (null);
			DataGridPageChangedEventArgs page_args = new DataGridPageChangedEventArgs (null, 0);
			DataGridSortCommandEventArgs sort_args = new DataGridSortCommandEventArgs (null,
					command_args);

			ResetEvents ();
			p.CancelCommand += new DataGridCommandEventHandler (CancelCommandHandler);
			p.DoCancelCommand (command_args);
			Assert.IsTrue (cancel_command, "A1");

			ResetEvents ();
			p.DeleteCommand += new DataGridCommandEventHandler (DeleteCommandHandler);
			p.DoDeleteCommand (command_args);
			Assert.IsTrue (delete_command, "A2");

			ResetEvents ();
			p.EditCommand += new DataGridCommandEventHandler (EditCommandHandler);
			p.DoEditCommand (command_args);
			Assert.IsTrue (edit_command, "A3");

			ResetEvents ();
			p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler);
			p.DoItemCommand (command_args);
			Assert.IsTrue (item_command, "A4");

			ResetEvents ();
			p.UpdateCommand += new DataGridCommandEventHandler (UpdateCommandHandler);
			p.DoUpdateCommand (command_args);
			Assert.IsTrue (update_command, "A5");

			ResetEvents ();
			p.ItemCreated += new DataGridItemEventHandler (ItemCreatedHandler);
			p.DoItemCreated (item_args);
			Assert.IsTrue (item_created, "A6");

			ResetEvents ();
			p.ItemDataBound += new DataGridItemEventHandler (ItemDataBoundHandler);
			p.DoItemDataBound (item_args);
			Assert.IsTrue (item_data_bound, "A7");

			ResetEvents ();
			p.PageIndexChanged += new DataGridPageChangedEventHandler (PageIndexChangedHandler);
			p.DoPageIndexChanged (page_args);
			Assert.IsTrue (page_index_changed, "A8");

			ResetEvents ();
			p.SortCommand += new DataGridSortCommandEventHandler (SortCommandHandler);
			p.DoSortCommand (sort_args);
			Assert.IsTrue (sort_command, "A9");
		}
		private void SortCommandHandler (object sender, DataGridSortCommandEventArgs e)
		{
			sort_command = true;
		}
Esempio n. 43
0
 private void dgList_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
     BLL.GridSort.SortCommand((DataGrid)source, ViewState, source, e);
     ((DataGrid)source).CurrentPageIndex = 0;
     LoadDataGrid();
 }
Esempio n. 44
0
        /// <summary>
        /// �����ͷ����
        /// </summary>
        /// <param name="e"></param>
        protected override void OnSortCommand(DataGridSortCommandEventArgs e)
        {
            base.OnSortCommand (e);       // �˾����ҳ�����Զ���ķ�����

              int index;

              String[] arr = e.SortExpression.Split(' ');
              if(arr.Length != 2) return;

              for(index=0; index<this.Columns.Count; index++)
              {
            if(this.Columns[index].SortExpression.ToLower() == e.SortExpression.ToLower())
              break;
              }

              // ��¼������䣬��ҳʱʹ��
              ViewState["__orderby"] = e.SortExpression;

              // �޸���һ�������еı���
              foreach(DataGridColumn column in this.Columns)
              {
            if(!column.Visible || column.HeaderText.Length==0) continue;
            else if((column.HeaderText[column.HeaderText.Length-1]=='��') || (column.HeaderText[column.HeaderText.Length-1]=='��'))
            {
              column.HeaderText = column.HeaderText.Substring(0, column.HeaderText.Length-1);
              break;
            }
              }
 private void gridAttachment_SortCommand(object source, DataGridSortCommandEventArgs e)
 {
     DataGrid dataGrid = (DataGrid) source;
       ShowGridAttachments(dataGrid, 0, e.SortExpression, "Ascending");
 }
Esempio n. 46
0
 protected void gPager_SortBefore(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
     BindData();
 }
 public void grddbo_ProspectiveBuyer_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
     htmlHiddenSortExpression.Value = e.SortExpression + " " + GetSortDirection(e.SortExpression);
     LoadGriddbo_ProspectiveBuyer();
 }
Esempio n. 48
0
 public void grddbo_DimDepartmentGroup_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
     htmlHiddenSortExpression.Value = e.SortExpression + " " + GetSortDirection(e.SortExpression);
     LoadGriddbo_DimDepartmentGroup();
 }
Esempio n. 49
0
        protected void Sort_Grid(Object sender, DataGridSortCommandEventArgs e)
        {
            #region 排序

            TopicTypeDataGrid.Sort = e.SortExpression.ToString();

            #endregion
        }
Esempio n. 50
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// The dgFileList_SortCommand server event handler on this user control runs when one
 /// of the Column Header Links is clicked
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 /// <remarks>
 /// </remarks>
 /// <history>
 /// 	[cnurse]	01/12/2007	Created
 /// </history>
 /// -----------------------------------------------------------------------------
 protected void dgFileList_SortCommand(object source, DataGridSortCommandEventArgs e)
 {
     BindFolderTree();
     IsRefresh = true;
     LastSort = Sort;
     if (Sort.Replace(" ASC", "").Replace(" DESC", "") == e.SortExpression)
     {
         //Switch order
         if (Sort.Contains("ASC"))
         {
             Sort = Sort.Replace("ASC", "DESC");
         }
         else
         {
             Sort = Sort.Replace("DESC", "ASC");
         }
     }
     else
     {
         Sort = e.SortExpression + " ASC";
     }
     MoveStatus = "";
     FilterFiles = "";
     BindFileList();
 }
Esempio n. 51
0
 public void grddbo_FactProductInventory_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
     htmlHiddenSortExpression.Value = e.SortExpression + " " + GetSortDirection(e.SortExpression);
     LoadGriddbo_FactProductInventory();
 }
Esempio n. 52
0
 private void dg_SortCommand(object source, DataGridSortCommandEventArgs e)
 {
     if((pc["ad_Logs_Sort"] != null) && (pc["ad_Logs_Sort"].ToString() == (string)e.SortExpression))
         pc["ad_Logs_Sort"] = (string)e.SortExpression + " DESC";
     else
         pc["ad_Logs_Sort"] = (string)e.SortExpression;
     BindDG();
 }
 protected void Datagrid1_SortCommand(object source, DataGridSortCommandEventArgs e)
 {
     oListPage.PrepareForSortCommand(e.SortExpression);
     Pager.CurrentPageIndex = 0;
     this.RefreshGrid();
 }
 private void dgSuministros_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
 }
Esempio n. 55
0
        protected override void OnSortCommand(DataGridSortCommandEventArgs e)
        {
            // Raise the obsolete event in case it's still in use
            RaiseSortChanged();

            base.OnSortCommand(e);
        }
 public void grddbo_AdventureWorksDWBuildVersion_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
 {
     htmlHiddenSortExpression.Value = e.SortExpression + " " + GetSortDirection(e.SortExpression);
     LoadGriddbo_AdventureWorksDWBuildVersion();
 }
 protected virtual new void OnSortCommand(DataGridSortCommandEventArgs e)
 {
 }
Esempio n. 58
0
 protected void gridJob_SortCommand(object source, DataGridSortCommandEventArgs e)
 {
     DataGrid dataGrid = (DataGrid) source;
       ShowGrid(dataGrid, 0, e.SortExpression, "Ascending");
 }
		public void DoSortCommand (DataGridSortCommandEventArgs e)
		{
			OnSortCommand (e);
		}
        }         // grdPagination_UpdateCommand

        /// <summary>
        ///Sorts the data.
        /// </summary>
        /// <param name="source"> The source of the event.</param>
        /// <param name="e"> Any arguments that the event fires.</param>
        private void grdPagination_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
        {
            this.SetSortOrder(e.SortExpression);
            this.ShowPagination(0);
        }