protected void g_SortCommand(object source, DataGridSortCommandEventArgs e) { DataGrid grid = (DataGrid)source; switch (grid.ID) { case "gReward": BindRewardData(); break; } }
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["ColorList"] as DataTable; DataView sortedView = new DataView(dataTable); sortedView.Sort = e.SortExpression + " " + sortingDirection; GridItemList.DataSource = sortedView; GridItemList.DataBind(); }
protected void dgBranchSummary_SortCommand(object sender, DataGridSortCommandEventArgs e) { if (hidSort.Attributes["sortType"] != null) { if (hidSort.Attributes["sortType"].ToString() == "ASC") { hidSort.Attributes["sortType"] = "DESC"; } else { hidSort.Attributes["sortType"] = "ASC"; } } else { hidSort.Attributes.Add("sortType", "ASC"); } hidSort.Value = e.SortExpression + " " + hidSort.Attributes["sortType"].ToString(); BindDataGrid(); pnldgrid.Update(); }
protected void gvRebate_SortCommand(object source, DataGridSortCommandEventArgs e) { if (hidSort.Attributes["sortType"] != null) { if (hidSort.Attributes["sortType"].ToString() == "ASC") { hidSort.Attributes["sortType"] = "DESC"; } else { hidSort.Attributes["sortType"] = "ASC"; } } else { hidSort.Attributes.Add("sortType", "ASC"); } hidSort.Value = e.SortExpression + " " + hidSort.Attributes["sortType"].ToString(); gvRebate.EditItemIndex = 0; BindGridRebate(); }
//This is invoked when the grid column is Clicked for Sorting, //Clicking again will Toggle Descending/Ascending through the Sort Expression protected void Grid_SortCommand(object sender, DataGridSortCommandEventArgs e) { DataSet myDataSet = GetViewState(); DataTable myDataTable = myDataSet.Tables[0]; GridViewSortExpression = e.SortExpression; //Gets the Pageindex of the GridView. int iPageIndex = UsersGrid.CurrentPageIndex; DataView _dataView = SortDataTable(myDataTable, false); UsersGrid.DataSource = _dataView; UsersGrid.DataBind(); UsersGrid.CurrentPageIndex = iPageIndex; // Rebind the sorted data into ViewState DataTable dt = new DataTable(); DataSet ds = new DataSet(); dt = _dataView.ToTable(); ds.Merge(dt); SetViewState(ds); }
protected void GridView1_SortCommand(object source, DataGridSortCommandEventArgs e) { if (hidSort.Attributes["sortType"] != null) { if (hidSort.Attributes["sortType"].ToString() == "ASC") { hidSort.Attributes["sortType"] = "DESC"; } else { hidSort.Attributes["sortType"] = "ASC"; } } else { hidSort.Attributes.Add("sortType", "DESC"); } hidSort.Value = "[" + e.SortExpression + "] " + hidSort.Attributes["sortType"].ToString(); Session["SortProfit"] = hidSort.Value; BindDataGrid(); }
private void DataGrid2_SortCommand_1(object source, DataGridSortCommandEventArgs e) { this.DataGrid2.CurrentPageIndex = 0; this.sortField = e.SortExpression.ToString() + ' ' + this.SortOrder.Text; this.sortLable.Text = this.sortField; if (this.ViewState["TestEasySearch"].ToString() == "true") { this.EasySearch(); } else { this.BindSearch(false, false, true); } if (this.SortOrder.Text == "DESC") { this.SortOrder.Text = "ASC"; } else { this.SortOrder.Text = "DESC"; } }
private void dgRates_SortCommand(object source, DataGridSortCommandEventArgs e) { if (e.SortExpression == SortCriteria) { // switch the direction if (SortDirection == "ASC") { SortDirection = "DESC"; } else { SortDirection = "ASC"; } } else { // apply the new sort SortCriteria = e.SortExpression; SortDirection = "DESC"; } BindRates(); }
protected void dgFind_SortCommand(object source, DataGridSortCommandEventArgs e) { if (hidSort.Attributes["sortType"] != null) { if (hidSort.Attributes["sortType"].ToString() == "ASC") { hidSort.Attributes["sortType"] = "DESC"; } else { hidSort.Attributes["sortType"] = "ASC"; } } else { hidSort.Attributes.Add("sortType", "ASC"); } hidSort.Value = e.SortExpression + " " + hidSort.Attributes["sortType"].ToString(); dtWorkOrders = (DataTable)Session["dtWorkOrders"]; BindDataGrid(); }
protected void dgItem_SortCommand(object source, DataGridSortCommandEventArgs e) { if (hidSort.Attributes["sortType"] != null) { if (hidSort.Attributes["sortType"].ToString() == "ASC") { hidSort.Attributes["sortType"] = "DESC"; } else { hidSort.Attributes["sortType"] = "ASC"; } } else { hidSort.Attributes.Add("sortType", "ASC"); } hidSort.Value = e.SortExpression + " " + hidSort.Attributes["sortType"].ToString(); //DataSet _dsShipListData = GetShipListData("search", txtSearchListName.Text, ddlLocation.SelectedValue, ddlUserId.SelectedValue, ddlListType.SelectedValue, dpStartDt.SelectedDate, dpEndDt.SelectedDate); BindDataGrid(); }
protected void RadGridDistributors_SortCommand(object source, DataGridSortCommandEventArgs e) { switch (e.SortExpression) { case "Name": SortExpression = "0"; break; case "NickName": SortExpression = "1"; break; case "PrimaryCoordinator": SortExpression = "2"; break; case "SecondaryCoordinator": SortExpression = "3"; break; } this.OrderBy = !this.OrderBy; this.PopulateDataGrid(); foreach (DataGridColumn col in this.RadGridDistributors.Columns) { if (col.Visible && col.SortExpression == e.SortExpression) { col.HeaderStyle.CssClass = "selected " + ((OrderBy == true) ? "sortDown" : "sortUp"); } else { col.HeaderStyle.CssClass = ((col.HeaderStyle.CssClass == "hide") ? "hide" : string.Empty); } } }
protected void dgVendor_SortCommand(object source, DataGridSortCommandEventArgs e) { if (hidSortVendor.Attributes["sortType"] != null) { if (hidSortVendor.Attributes["sortType"].ToString() == "ASC") { hidSortVendor.Attributes["sortType"] = "DESC"; } else { hidSortVendor.Attributes["sortType"] = "ASC"; } } else { hidSortVendor.Attributes.Add("sortType", "ASC"); } hidSortVendor.Value = e.SortExpression + " " + hidSortVendor.Attributes["sortType"].ToString(); BindVendorPODetails(); SelectGridItem(); pnlVendorItemDetails.Update(); }
public void dgUsers_SortCommand(object source, DataGridSortCommandEventArgs e) { try { string sCnxn = ConfigurationManager.AppSettings["Cnxn"]; string sLogPath = ConfigurationManager.AppSettings["LogPath"]; // // One way to sort: //Users oUsers = new Users(sCnxn, sLogPath); //List<User> oUserList = new List<User>(); //oUserList.AddRange(oUsers.Values); //if (e.SortExpression.ToUpper() == "FIRSTNAME") // oUserList.Sort(delegate (User u1, User u2) { return u1.FirstName.CompareTo(u2.FirstName); }); //if (e.SortExpression.ToUpper() == "LASTNAME") // oUserList.Sort(delegate (User u1, User u2) { return u1.LastName.CompareTo(u2.LastName); }); //if (e.SortExpression.ToUpper() == "USERID") // oUserList.Sort(delegate (User u1, User u2) { return u1.UserID.CompareTo(u2.UserID); }); // // Another way to sort: Users oUsers = new Users(); DataTable dtUsers = oUsers.UsersList(sCnxn, sLogPath); DataView dvUsers = dtUsers.DefaultView; dvUsers.Sort = e.SortExpression; this.dgUsers.DataSource = dvUsers; //oUserList; this.dgUsers.DataBind(); } catch (Exception ex) { this.lblError.Text = ex.Message; } }
protected void gPager_SortBefore(object source, DataGridSortCommandEventArgs e) { long userID = -1L; try { userID = _Convert.StrToLong(Utility.GetRequest("id"), -1L); } catch { } if (userID < 1L) { PF.GoError(1, "参数错误", base.GetType().FullName); } else if (!new Lottery().ValidID(this.LotteryID)) { PF.GoError(1, "参数错误!(彩种)", base.GetType().FullName); } else { this.BindData(userID, this.LotteryID); } }
protected void dgWorkSheet_SortCommand(object source, DataGridSortCommandEventArgs e) { if (hidSort.Attributes["sortType"] != null) { if (hidSort.Attributes["sortType"].ToString() == "ASC") { hidSort.Attributes["sortType"] = "DESC"; } else { hidSort.Attributes["sortType"] = "ASC"; } } else { hidSort.Attributes.Add("sortType", "DESC"); } hidSort.Value = e.SortExpression + " " + hidSort.Attributes["sortType"].ToString(); BindDataGrid(); PrintDialogue1.PageUrl = hidPreviewURL.Value + "&SortCommand=" + hidSort.Value; pnlExport.Update(); }
public void ImageList_Sort_FieldIsNotImageName_DirectionIsASC() { // Arrange ShimimageGallery.AllInstances.loadImagesTable = (c) => { }; var args = new DataGridSortCommandEventArgs( this, new DataGridCommandEventArgs( new DataGridItem(0, 0, ListItemType.Item), this, new CommandEventArgs(ViewStateSortField, AnyString))); var viewState = (StateBag)ReflectionHelper.GetPropertyValue((UserControl)_gallery, ViewStateProperty); viewState[ViewStateSortField] = ImageName; viewState[ViewStateSortDirection] = Desc; // Act ReflectionHelper.CallMethod(typeof(imageGallery), "ImageList_Sort", new object[] { this, args }, _gallery); // Assert _gallery.ShouldSatisfyAllConditions( () => viewState[ViewStateSortField].ShouldBe(AnyString), () => viewState[ViewStateSortDirection].ShouldBe(Asc)); }
private void DgStudents_SortCommand(object source, DataGridSortCommandEventArgs e) { var dest = SortDestination; var sortCol = SortCol; if (e.SortExpression.Equals(sortCol)) { if (dest == SortDest.ASC) { SortDestination = SortDest.DESC; } else { SortDestination = SortDest.ASC; } SortCol = e.SortExpression; } else { SortDestination = SortDest.ASC; SortCol = e.SortExpression; } dsStudents.SelectCommand = string.Format("select * from Students order by {0} {1}", SortCol, SortDestination); }
protected void grdData_Sort(Object source, DataGridSortCommandEventArgs e) { string[] strSort = e.SortExpression.Split('|'); if (strSort[0] == ViewState["SortField"].ToString()) { if (ViewState["SortOrder"].ToString() == "ASC") { ViewState["SortOrder"] = "DESC"; } else { ViewState["SortOrder"] = "ASC"; } } else { ViewState["SortOrder"] = strSort[1]; } ViewState["SortField"] = strSort[0]; BindGrid(); }
protected void dgList_SortCommand(object source, DataGridSortCommandEventArgs e) { this.gpControl.CurrentPageIndex = 1; string sql = ""; if (this.ViewState["sorttype"] == "") { this.ViewState["sorttype"] = " "; this.ViewState["sortfield"] = e.SortExpression; } else { if (this.ViewState["sortfield"].ToString() == e.SortExpression) { if (this.ViewState["sorttype"].ToString() == " ") { this.ViewState["sorttype"] = " desc"; } else { this.ViewState["sorttype"] = " "; } } else { this.ViewState["sortfield"] = e.SortExpression; this.ViewState["sorttype"] = " desc"; } } string sortsql = this.ViewState["sortfield"].ToString() + this.ViewState["sorttype"].ToString(); sql = this.ViewState["SelectString"].ToString() + " order by " + sortsql; this.ViewState.Add("SqlString", sql); LoadData(); }
protected void SortGrid(object sender, DataGridSortCommandEventArgs e) { this.SortTable(e.SortExpression, null); foreach (DataGridColumn dataGridColumn in this.Columns) { if (dataGridColumn.SortExpression == e.SortExpression) { if (dataGridColumn.HeaderText.IndexOf("<img src=") >= 0) { if (this.DataGridSortType == "ASC") { dataGridColumn.HeaderText = dataGridColumn.HeaderText.Replace("<img src=" + this.ImagePath + "asc.gif height=13>", "<img src=" + this.ImagePath + "desc.gif height=13>"); } else { dataGridColumn.HeaderText = dataGridColumn.HeaderText.Replace("<img src=" + this.ImagePath + "desc.gif height=13>", "<img src=" + this.ImagePath + "asc.gif height=13>"); } } else { if (this.DataGridSortType == "ASC") { dataGridColumn.HeaderText = dataGridColumn.HeaderText + "<img src=" + this.ImagePath + "desc.gif height=13>"; } else { dataGridColumn.HeaderText = dataGridColumn.HeaderText + "<img src=" + this.ImagePath + "asc.gif height=13>"; } } } else { dataGridColumn.HeaderText = dataGridColumn.HeaderText.Replace("<img", "~").Split('~')[0]; } } }
protected void dgGroupMenu_SortCommand(object source, DataGridSortCommandEventArgs e) { }
protected void dgItemSubCategory_SortCommand(object source, DataGridSortCommandEventArgs e) { }
protected void gRewardPager_SortBefore(object source, DataGridSortCommandEventArgs e) { this.BindDataInvestHistory(); }
protected void g_SortCommand(object source, DataGridSortCommandEventArgs e) { DataGrid grid = (DataGrid)source; string iD = grid.ID; if (iD != null) { if (!(iD == "g")) { if (!(iD == "gHistory")) { if (!(iD == "gReward")) { if (!(iD == "gUserPay")) { if (!(iD == "gUserDistills")) { if (iD == "gScoring") { this.BindScoring(); } return; } this.BindDistills(); return; } this.BindUserPayData(); return; } this.BindRewardData(); return; } } else { this.BindData(); return; } this.BindHistoryData(); } }
private void Util_GetSortExpression(DataGrid dg, DataGridSortCommandEventArgs e) { string[] sortColumns = null; string sortAttribute = dg.Attributes["SortExpression"]; //Check to See if we have an existing Sort Order already in the Grid. //If so get the Sort Columns into an array if (e.SortExpression != sortAttribute) { sortAttribute = e.SortExpression; } if (sortAttribute != string.Empty) { sortColumns = sortAttribute.Split(",".ToCharArray()); } //if User clicked on the columns in the existing sort sequence. //Toggle the sort order or remove the column from sort appropriately if (sortAttribute.IndexOf(e.SortExpression) > 0 || sortAttribute.StartsWith(e.SortExpression)) { sortAttribute = Util_ModifySortExpression(sortColumns, e.SortExpression); } else { sortAttribute += e.SortExpression + " ASC,"; } dg.Attributes["SortExpression"] = sortAttribute; // Return sortAttribute Util_GetSortValue(sortAttribute); }
protected void GridViewReconSum_SortCommand(object source, DataGridSortCommandEventArgs e) { SortExpression = e.SortExpression; setDataSource(GridViewReconSum, dtSummary, SortExpression); }
protected void g_SortCommand(object source, DataGridSortCommandEventArgs e) { DataGrid grid = (DataGrid)source; BindHistoryData(); }
protected void dgListData_SortCommand(object source, DataGridSortCommandEventArgs e) { if (!this.sortBy.Contains("desc")) { this.sortBy = e.SortExpression + " desc"; } else { this.sortBy = e.SortExpression + " asc "; } BindGrid(); }
protected void dtgSCTabel_SortCommand(object source, DataGridSortCommandEventArgs e) { }
protected void gPagerInvest_SortBefore(object source, DataGridSortCommandEventArgs e) { this.BindInvest(null); }
protected void dgListData_SortCommand(object source, DataGridSortCommandEventArgs e) { DataGridSortCommand(e); }
protected void dgProduct_SortCommand(object source, DataGridSortCommandEventArgs e) { //ViewState["OrderFloor"] = null; // ViewState["flag"] = null; // Response.Write(e.SortExpression); }
protected void dgSitecardList_SortCommand(object source, DataGridSortCommandEventArgs e) { }
protected void gridSupps_SortCommand(object source, DataGridSortCommandEventArgs e) { if (lblSort.Text == e.SortExpression) { lblSort.Text = e.SortExpression + " DESC"; } else { lblSort.Text = e.SortExpression; } FillSuppliersList(); }
protected void gPager1_SortBefore(object source, DataGridSortCommandEventArgs e) { this.BindTransactionList(); }
protected void grdDados_SortCommand(object source, DataGridSortCommandEventArgs e) { if (listPager.DataSource != null && listPager.DataSource is IEnumerable <GrupoBanners> ) { IEnumerable <GrupoBanners> dados = (IEnumerable <GrupoBanners>)listPager.DataSource; SortField = e.SortExpression; if ((e.SortExpression == SortField)) { if (AscendingSort) { AscendingSort = false; } else { AscendingSort = true; } } else { AscendingSort = true; } foreach (DataGridColumn c in grdDados.Columns) { c.HeaderStyle.CssClass = string.Format("tabelaHeader"); } foreach (DataGridColumn c in grdDados.Columns) { if ((!string.IsNullOrWhiteSpace(c.SortExpression) && c.SortExpression.Equals(e.SortExpression, StringComparison.OrdinalIgnoreCase))) { if (AscendingSort) { c.HeaderStyle.CssClass = string.Format("tabelaHeader asc"); } else { c.HeaderStyle.CssClass = string.Format("tabelaHeader desc"); } break; } } #region Campos Sorting switch (e.SortExpression) { case "IdGrupo": if (AscendingSort) { dados = dados.OrderBy(u => u.IdGrupo).ToArray(); } else { dados = dados.OrderByDescending(u => u.IdGrupo).ToArray(); } break; case "Descricao": if (AscendingSort) { dados = dados.OrderBy(u => u.Descricao).ToArray(); } else { dados = dados.OrderByDescending(u => u.Descricao).ToArray(); } break; default: if (AscendingSort) { dados = dados.OrderBy(u => u.Descricao).ToArray(); } else { dados = dados.OrderByDescending(u => u.Descricao).ToArray(); } break; } #endregion listPager.DataSource = dados; listPager.DataBind(); BindGrid(); } }
protected void g_SortCommand(object source, DataGridSortCommandEventArgs e) { BindData(); }
protected void gPager_SortBefore(object source, DataGridSortCommandEventArgs e) { this.BindBuyDetailData(); }
protected void dataGrid_SortCommand(object source, DataGridSortCommandEventArgs e) { BindData(e.SortExpression); }
protected void Datagrid1_SortCommand(object source, DataGridSortCommandEventArgs e) { oListPage.PrepareForSortCommand(e.SortExpression); Pager.CurrentPageIndex = 0; this.RefreshGrid(); }
protected void g_SortCommand(object source, DataGridSortCommandEventArgs e) { DataGrid grid = (DataGrid)source; if (grid.ID == "g") { BindData(); } else if (grid.ID == "gSetFollowScheme") { BindDataForFriendFollowScheme(); } else if (grid.ID == "gWhoFollowSchemes") { } }
protected void g1_SortCommand(object source, DataGridSortCommandEventArgs e) { this.BindData(); }
protected void gInvestHistory_SortCommand(object source, DataGridSortCommandEventArgs e) { this.BindDataInvestHistory(); }
protected void Sort_Grid(Object sender, DataGridSortCommandEventArgs e) { DataGrid1.Sort = e.SortExpression.ToString(); }
protected void g_SortCommand(object source, DataGridSortCommandEventArgs e) { DataGrid grid = (DataGrid)source; switch (grid.ID) { case "gUserDistills": BindDistills(); break; } }
protected void g_SortCommand(object source, DataGridSortCommandEventArgs e) { DataGrid grid = (DataGrid)source; switch (grid.ID) { case "gHistory": Script = "ShowOrHiddenDiv(\"divHistory\");clickTabMenu(document.getElementById(\"tdHistory\"),'url(images/admin_qh_100_1.jpg)', 'myIcaileTab');"; BindHistoryData(); break; case "gReward": Script = "ShowOrHiddenDiv(\"divReward\");clickTabMenu(document.getElementById(\"tdReward\"), 'url(images/admin_qh_100_1.jpg)', 'myIcaileTab');"; BindDataReward(); break; } }
protected void DataGridSortCommand(DataGridSortCommandEventArgs dtg) { if (!this.mlSORTBY.Contains("desc")) { this.mlSORTBY = dtg.SortExpression + " desc"; } else { this.mlSORTBY = dtg.SortExpression + " asc "; } BindGrid(); }
protected void gPagerWin_SortBefore(object source, DataGridSortCommandEventArgs e) { this.BindWin(null); }
protected void SortResults(object sender, DataGridSortCommandEventArgs e) { BindData(e.SortExpression); }
protected void Datagrid2_SortCommand(object source, DataGridSortCommandEventArgs e) { oListPage2.PrepareForSortCommand(e.SortExpression); this.RefreshGrid2(); }
protected void g_SortCommand(object source, DataGridSortCommandEventArgs e) { DataGrid grid = (DataGrid)source; switch (grid.ID) { case "gScoring": BindScoring(); break; } }
protected void gPager_SortBefore(object source, DataGridSortCommandEventArgs e) { this.BindData(); }
protected void g2_SortCommand(object source, DataGridSortCommandEventArgs e) { BindChaseComboData(); }
public void dgSearchList_SortClick(object sender, DataGridSortCommandEventArgs e) { // ie the Sortexpression assigned to the Column.Check STEP III for how to assign a // sortexpression on a column. PopulateDatagrid(e.SortExpression); //Call the method that populates the Datagrid with //the values from the Dataview. }
protected void gPager2_SortBefore(object source, DataGridSortCommandEventArgs e) { this.BindChaseComboData(); }
//The SortCommand event handler public void Recipes_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) { this.DataGrid1.Sort = e.SortExpression; }
protected void g_SortCommand(object source, DataGridSortCommandEventArgs e) { DataGrid grid = (DataGrid)source; string iD = grid.ID; if (iD != null) { if (!(iD == "gHistory")) { if (!(iD == "gReward")) { return; } } else { this.BindHistoryData(); return; } this.BindDataReward(); } }