protected void gvReport_Sorting(object sender, GridViewSortEventArgs e)
        {
            DonorList DL = new DonorList();

            string[] SortOrder = ViewState["SortExpr"].ToString().Split(' ');
            if (SortOrder[0] == e.SortExpression)
            {
                if (SortOrder[1] == "ASC")
                {
                    ViewState["SortExpr"] = e.SortExpression + " " + "DESC";
                }
                else
                {
                    ViewState["SortExpr"] = e.SortExpression + " " + "ASC";
                }
            }
            else
            {
                ViewState["SortExpr"] = e.SortExpression + " " + "ASC";
            }

            gvReport.PageIndex = 0;

            gvReport.DataSource = DL.GetDonorDemoUpdates(ViewState["SortExpr"].ToString());
            gvReport.DataBind();

        }
        protected void dtgReservas_Sorting(object sender, GridViewSortEventArgs e)
        {
            if (dtbPesquisa != null)
            {
                string ordem = e.SortExpression;

                DataView m_DataView = new DataView(dtbPesquisa);

                if (ViewState["dtbPesquisa_sort"] != null)
                {
                    if (ViewState["dtbPesquisa_sort"].ToString() == e.SortExpression)
                    {
                        m_DataView.Sort = ordem + " DESC";
                        ViewState["dtbPesquisa_sort"] = null;
                    }
                    else
                    {
                        m_DataView.Sort = ordem;
                        ViewState["dtbPesquisa_sort"] = e.SortExpression;
                    }
                }
                else
                {
                    m_DataView.Sort = ordem;
                    ViewState["dtbPesquisa_sort"] = e.SortExpression;
                }

                dtbPesquisa = m_DataView.ToTable();
                dtgReservas.DataSource = m_DataView;
                dtgReservas.DataBind();
            }
        }
        protected void theGrid_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            string currentSortColumn    = null;
            string currentSortDirection = null;

            currentSortColumn    = this.SortExpression.Split(' ')[0];
            currentSortDirection = this.SortExpression.Split(' ')[1];

            if (e.SortExpression.Equals(currentSortColumn))
            {
                switch (currentSortDirection.ToUpper())
                {
                case "ASC":
                    currentSortDirection = "DESC";
                    break;

                case "DESC":
                    currentSortDirection = "ASC";
                    break;
                }
            }
            else
            {
                currentSortColumn    = e.SortExpression;
                currentSortDirection = "ASC";
            }

            Books.DataSource = GetCurrentBooks(currentSortColumn, currentSortDirection);
            Books.DataBind();

            this.SortExpression = currentSortColumn + " " + currentSortDirection;
        }
        protected void gvReport_Sorting(object sender, GridViewSortEventArgs e)
        {
            DonorEventList DEL = new DonorEventList(User.Identity.Name);
            EventList EL = new EventList(User.Identity.Name, int.Parse(Request["eid"].ToString()));



            string[] SortOrder = ViewState["SortExpr"].ToString().Split(' ');
            if (SortOrder[0] == e.SortExpression)
            {
                if (SortOrder[1] == "ASC")
                {
                    ViewState["SortExpr"] = e.SortExpression + " " + "DESC";
                }
                else
                {
                    ViewState["SortExpr"] = e.SortExpression + " " + "ASC";
                }
            }
            else
            {
                ViewState["SortExpr"] = e.SortExpression + " " + "ASC";
            }

            gvReport.PageIndex = 0;
            gvReport.DataSource = DEL.GetDonorEventMailedTickets_ByEvent(EL.pk_Event, ViewState["SortExpr"].ToString());
            gvReport.DataBind();
        }
        private void SortGridview(System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            try
            {
                dt = Session[clsConstant.SESS_TABLE] as DataTable;
                if (!dt.Columns.Contains("iPerformanceFlagsAID"))
                {
                    dt.Columns.Add("iPerformanceFlagsAID");
                }
                if (!dt.Columns.Contains("iAppFirstContractAward"))
                {
                    dt.Columns.Add("iAppFirstContractAward");
                }

                if (dt != null)
                {
                    dt.DefaultView.Sort = e.SortExpression + " " + GetSortDirection(e.SortExpression);
                    grdProjectPerformanceGroupADetail.DataSource = Session[clsConstant.SESS_TABLE];
                    grdProjectPerformanceGroupADetail.DataBind();
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }
        }
 protected void gvAgency_Sorting(object sender, GridViewSortEventArgs e)
 {
     LunchboxGridView4.Order(SearchResults.AsQueryable(), e.SortExpression);
     hiddenmulti.Style.Clear();
     masssubmit.Style.Clear();
     reset.Style.Clear();
 }
 protected void GridViewProducts_Sorting(object sender, GridViewSortEventArgs e)
 {
     Product.SortColumn = e.SortExpression;
     product.Sort();
     GridViewProducts.DataSource = product;
     GridViewProducts.DataBind();
 }
 protected void gvMOnthlySOI_Sorting(object sender, GridViewSortEventArgs e)
 {
     if (!string.IsNullOrEmpty(txtSearch.Text))
     {
         MonthlySOIManager.SearchMonthlySOI(SqlDataSourceMonthlySOI, txtSearch.Text);
     }
 }
 protected void FantasyDetailsGridView_Sorting(object sender, GridViewSortEventArgs e)
 {
     DataTable temp = (DataTable)FantasyDetailsGridView.DataSource;
     temp.DefaultView.Sort = e.SortExpression + " " + GetSortDirection(e.SortExpression);
     FantasyDetailsGridView.DataSource = temp;
     FantasyDetailsGridView.DataBind();
 }
 protected void gvStock_Sorting(object sender, GridViewSortEventArgs e)
 {
     DataView sortedView = new DataView(dtView);
     sortedView.Sort = e.SortExpression + " " + "Asc";
     gvStock.DataSource = sortedView;
     gvStock.DataBind();
 }
Beispiel #11
0
    protected void grd_order_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
    {
        Gridview_Bind_Ordes();

        DataTable dt = new DataTable();

        dt = dtselect;
        string sortingDirection = string.Empty;

        if (sortProperty == SortDirection.Ascending)
        {
            sortProperty     = SortDirection.Descending;
            sortingDirection = "Desc";
        }
        else
        {
            sortProperty     = SortDirection.Ascending;
            sortingDirection = "Asc";
        }

        DataView sortedView = new DataView(dt);

        sortedView.Sort      = e.SortExpression + " " + sortingDirection;
        grd_order.DataSource = sortedView;
        grd_order.DataBind();
    }
 protected void gwStudent_Sorting(object sender, GridViewSortEventArgs e)
 {
     GridViewSortExpression = e.SortExpression;
     int pageIndex = gwStudent.PageIndex;
     gwStudent.DataSource = SortDataTable(gwStudent.DataSource as DataTable, false);
     gwStudent.DataBind();
 }
Beispiel #13
0
        protected void ErrorLog_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            var sortDirection = ((e.SortDirection == System.Web.UI.WebControls.SortDirection.Ascending) ? "ASC" : "DESC");

            ErrorLog.DataSource = errorLogEntries.OrderBy(e.SortExpression + " " + sortDirection).ToList();
            Bind();
        }
Beispiel #14
0
        protected void gvSearchResults_OnSorting(object sender, GridViewSortEventArgs e)
        {
            if (Session["Title"] == null)
            {
                lblMessage.Text = "Session Timed Out.";
                lblMessage.ForeColor = System.Drawing.Color.Red;
            }
            else
            {
                DataSet ds = GetData(Session["Title"].ToString());

                if (ds != null)
                {

                    DataView dview = ds.Tables[0].DefaultView;
                    if (Session["sort"] == null || Session["sort"].ToString() == "ASC")
                    {
                        e.SortDirection = SortDirection.Ascending;
                        dview.Sort = e.SortExpression + " " + ConvertSortDirectionToSql(e.SortDirection);
                        Session["sort"] = "DESC";
                    }
                    else
                    {
                        e.SortDirection = SortDirection.Descending;
                        dview.Sort = e.SortExpression + " " + ConvertSortDirectionToSql(e.SortDirection);
                        Session["sort"] = "ASC";
                    }

                    gvSearchResults.DataSource = dview;
                    gvSearchResults.DataBind();
                }
            }
        }
Beispiel #15
0
        protected void ItemList_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            var sortDirection = ((e.SortDirection == System.Web.UI.WebControls.SortDirection.Ascending) ? "ASC" : "DESC");

            Items = Items.OrderBy(e.SortExpression + " " + sortDirection).ToList();
            Bind();
        }
 protected void StudentGrid_Sorting(object sender, GridViewSortEventArgs e)
 {
     DataView view = new DataView(BindData());
     view.Sort = e.SortExpression + " " + "Asc";
     StudentGrid.DataSource = view;
     StudentGrid.DataBind();
 }
 protected void gridEmployees_Sorting(object sender, GridViewSortEventArgs e)
 {
     if (e.SortExpression == "FirstName" && sourceEmployeesSortedGridView.SortExpression == "LastName")
       {
     e.SortExpression = "LastName, FirstName";
       }
 }
        protected override void OnSorting(GridViewSortEventArgs e)
        {
            foreach (DataControlField column in Columns)
            {
                if (column.SortExpression == e.SortExpression)
                {
                    column.HeaderStyle.CssClass = "sorted";
                    column.HeaderStyle.BackColor = Color.Khaki;

                    if (e.SortDirection == SortDirection.Descending)
                        column.HeaderText = ViewState[column.SortExpression] + " [asc]";
                    else
                        column.HeaderText = ViewState[column.SortExpression] + " [desc]";
                }
                else
                {
                    if (ViewState[column.SortExpression] != null)
                        column.HeaderText = ViewState[column.SortExpression] as string;
                    column.HeaderStyle.CssClass = "";
                    column.HeaderStyle.BackColor = Color.White;
                }
            }

            base.OnSorting(e);
        }
Beispiel #19
0
        protected void gvAlerts_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            SortedColumn = e.SortExpression;
            Direction    = Direction == SortDirection.Ascending ? SortDirection.Descending : SortDirection.Ascending;

            DoSort(Direction, e.SortExpression);
        }
        protected void agvCustomers_Sorting(object sender, GridViewSortEventArgs e)
        {
            var arrows = new Dictionary<string, string>
                {
                    {"Lastname", "arrowLastname"},
                    {"Firstname", "arrowFirstname"},
                    {"Email", "arrowEmail"},
                };

            string urlArrowUp = UrlService.GetAdminAbsoluteLink("images/arrowup.gif");
            string urlArrowDown = UrlService.GetAdminAbsoluteLink("images/arrowdown.gif");
            string urlArrowGray = UrlService.GetAdminAbsoluteLink("images/arrowdownh.gif");

            Field csf = (from Field f in _paging.Fields.Values where f.Sorting.HasValue select f).First();
            Field nsf = _paging.Fields[e.SortExpression];

            if (nsf.Name.Equals(csf.Name))
            {
                csf.Sorting = csf.Sorting == SortDirection.Ascending ? SortDirection.Descending : SortDirection.Ascending;
                agvCustomers.ChangeHeaderImageUrl(arrows[csf.Name],
                                                  (csf.Sorting == SortDirection.Ascending ? urlArrowUp : urlArrowDown));
            }
            else
            {
                csf.Sorting = null;
                agvCustomers.ChangeHeaderImageUrl(arrows[csf.Name], urlArrowGray);
                nsf.Sorting = SortDirection.Ascending;
                agvCustomers.ChangeHeaderImageUrl(arrows[nsf.Name], urlArrowUp);
            }

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex = 1;
        }
Beispiel #21
0
        protected void gridView_Sorting(object sender, GridViewSortEventArgs e)
        {
            PopulateGrid();

            List<Computer> listComputers = (List<Computer>) gvComputers.DataSource;
            switch (e.SortExpression)
            {
                case "Name":
                    listComputers = GetSortDirection(e.SortExpression) == "Desc"
                        ? listComputers.OrderByDescending(h => h.Name).ToList()
                        : listComputers.OrderBy(h => h.Name).ToList();
                    break;
                case "Mac":
                    listComputers = GetSortDirection(e.SortExpression) == "Desc"
                        ? listComputers.OrderByDescending(h => h.Mac).ToList()
                        : listComputers.OrderBy(h => h.Mac).ToList();
                    break;
                case "Image":
                    listComputers = GetSortDirection(e.SortExpression) == "Desc"
                        ? listComputers.OrderByDescending(h => h.ImageId).ToList()
                        : listComputers.OrderBy(h => h.ImageId).ToList();
                    break;
            }

            gvComputers.DataSource = listComputers;
            gvComputers.DataBind();
        }
Beispiel #22
0
        // sets sort order and re-binds page.
        
        protected void GridViewOrders_Sorting(object sender, GridViewSortEventArgs e)
        {
            SortDirection = (SortDirection == "ASC") ? "DESC" : "ASC";
            SortColumn = e.SortExpression;

            Bind();
        }
        protected void grid_Sorting(object sender, GridViewSortEventArgs e)
        {
            var arrows = new Dictionary<string, string>
                {
                    {"Name", "arrowName"},
                    {"VideoSortOrder", "arrowVideoSortOrder"}
                };
            const string urlArrowUp = "~/admin/images/arrowup.gif";
            const string urlArrowDown = "~/admin/images/arrowdown.gif";
            const string urlArrowGray = "~/admin/images/arrowdownh.gif";

            Field csf = (from Field f in _paging.Fields.Values where f.Sorting.HasValue select f).First();
            Field nsf = _paging.Fields[e.SortExpression];

            if (nsf.Name.Equals(csf.Name))
            {
                csf.Sorting = csf.Sorting == SortDirection.Ascending ? SortDirection.Descending : SortDirection.Ascending;
                grid_video.ChangeHeaderImageUrl(arrows[csf.Name],
                                                (csf.Sorting == SortDirection.Ascending ? urlArrowUp : urlArrowDown));
            }
            else
            {
                csf.Sorting = null;
                grid_video.ChangeHeaderImageUrl(arrows[csf.Name], urlArrowGray);

                nsf.Sorting = SortDirection.Ascending;
                grid_video.ChangeHeaderImageUrl(arrows[nsf.Name], urlArrowUp);
            }

            pageNumberer.CurrentPageIndex = 1;
            _paging.CurrentPageIndex = 1;
        }
Beispiel #24
0
        protected void GridView1_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            string StrSortDirection = "";


            if (ViewState["DiscountPrice" + "Direction"] == null)
            {
                ViewState.Add("DiscountPrice" + "Direction", "desc");
            }
            else
            {
                StrSortDirection = ViewState["DiscountPrice" + "Direction"].ToString();
            }
            if (StrSortDirection == "desc")
            {
                StrSortDirection = "asc";
            }
            else
            {
                StrSortDirection = "desc";
                ViewState["DiscountPrice" + "Direction"] = StrSortDirection;
            }
            ViewState["DiscountPrice"] = e.SortExpression + " " + StrSortDirection;
            BindGrid();
        }
        protected void GridView1_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            string StrSortDirection;

            if (ViewState["ExplanRepeatID" + "Direction"] == null)
            {
                ViewState.Add("ExplanRepeatID" + "Direction", "desc");
            }


            StrSortDirection = ViewState["PersonalLearning" + "Direction"].ToString();

            if (StrSortDirection == "desc")
            {
                StrSortDirection = "asc";
            }
            else
            {
                StrSortDirection = "desc";
            }

            ViewState["ExplanRepeatID" + "Direction"] = StrSortDirection;
            ViewState["ExplanRepeatID"] = e.SortExpression + " " + StrSortDirection;
            BindGrid();
        }
Beispiel #26
0
        protected void gridView_Sorting(object sender, GridViewSortEventArgs e)
        {
            PopulateGrid();
            List<Models.Group> listGroups = (List<Models.Group>)gvGroups.DataSource;
            switch (e.SortExpression)
            {
                case "Name":
                    listGroups = GetSortDirection(e.SortExpression) == "Asc" ? listGroups.OrderBy(g => g.Name).ToList() : listGroups.OrderByDescending(g => g.Name).ToList();
                    break;
                case "Image":
                    listGroups = GetSortDirection(e.SortExpression) == "Asc" ? listGroups.OrderBy(g => g.ImageId).ToList() : listGroups.OrderByDescending(g => g.ImageId).ToList();
                    break;
                case "Type":
                    listGroups = GetSortDirection(e.SortExpression) == "Asc" ? listGroups.OrderBy(g => g.Type).ToList() : listGroups.OrderByDescending(g => g.Type).ToList();
                    break;              
            } 

            gvGroups.DataSource = listGroups;
            gvGroups.DataBind();
            foreach (GridViewRow row in gvGroups.Rows)
            {
                var group = new Models.Group();
                var lbl = row.FindControl("lblCount") as Label;
                var dataKey = gvGroups.DataKeys[row.RowIndex];
                if (dataKey != null)
                    group = BLL.Group.GetGroup(Convert.ToInt32(dataKey.Value));              
                if (lbl != null)
                    lbl.Text = BLL.GroupMembership.GetGroupMemberCount(group.Id);
            }
        }
Beispiel #27
0
 /// <summary>
 /// Name:Page_Load
 /// Description:when user clicks on grid header text value then grid's
 /// column values are sorted in ascending and descending order.
 /// Author:Monal Shah
 /// created Date:2010/10/21
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void EmployeeGrid_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
 {
     try
     {
         GridViewSortExpression      = e.SortExpression;
         ViewState["SortExpression"] = e.SortExpression;
         objDt1      = new DataTable();
         objSbSelect = new StringBuilder();
         objSbSelect.Append("Select ");
         objSbSelect.Append("* ");
         objSbSelect.Append("From ");
         objSbSelect.Append("TblEmployee");
         objcl.GetSqlStmt = objSbSelect.ToString();
         objDt1           = objcl.DataTables();
         objDv            = new DataView(objDt1);
         string direction = GetSortDirection();
         objDv.Sort = GridViewSortExpression + " " + direction;
         this.EmployeeGrid.DataSource = objDv;
         this.EmployeeGrid.DataBind();
     }
     catch (Exception)
     {
         Response.Redirect("Error.aspx", false);
     }
 }
        protected void GvNumberOfStudentByProgram_Sorting(object sender, GridViewSortEventArgs e)
        {
            string SortColumn = e.SortExpression.ToString();

                 Session["Column"] = SortColumn;

                 LoadNumberOfStudentByProgram(SortColumn);
        }
Beispiel #29
0
		protected void GridView1_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
		{
			GridView1.PageIndex = 0;
			GridView1.SelectedIndex = -1;
			SelectedKey = null;
			SortedDirection = (SortedDirection == "DESC" ? "ASC" : "DESC");
			Order = e.SortExpression;
		}
Beispiel #30
0
 protected void grdMain_Sorting(object sender, GridViewSortEventArgs e)
 {
     if (Session["IdentifierList_Sort"].ToString() == e.SortExpression)
         Session["IdentifierList_Sort"] += " DESC";
     else
         Session["IdentifierList_Sort"] = e.SortExpression;
     BindData();
 }
 protected void grdParlamentar_Sorting(object sender, GridViewSortEventArgs e)
 {
     if ((grdParlamentar.DataSource) != null)
     {
         ((DataTable)(grdParlamentar.DataSource)).DefaultView.Sort = e.SortExpression + " " + gerenciaOrdenacao();
         grdParlamentar.DataBind();
     }
 }
 protected void gvCustomers_Sorting(object sender, GridViewSortEventArgs e)
 {
     if (!string.IsNullOrEmpty(txtSearchCustomer.Text))
     {
         DRManager.SeachCustomers(SqlDataSourceCustomers, txtSearchCustomer.Text);
     }
     btnBrowseCustomer_ModalPopupExtender.Show();
 }
Beispiel #33
0
 protected void grdMain_Sorting(object sender, GridViewSortEventArgs e)
 {
     if (this.Session["EnumList_Sort"].ToString() == e.SortExpression)
         this.Session["EnumList_Sort"] += " DESC";
     else
         this.Session["EnumList_Sort"] = e.SortExpression;
     BindData();
 }
     void gvPackage_OnSorting(object sender, GridViewSortEventArgs e)
 {
     LinkButton lnkbtn = (LinkButton)sender;
     SetSorting(lnkbtn.CommandArgument);
     DataTable dt = Session["FilterDataTable"] == null ? (DataTable)Session["GetDataTable"] : (DataTable)Session["FilterDataTable"];
     ucPaging1.BindPaging(gvPackage, dt, ucPaging1.PageNo, ucPaging1.NavType, Convert.ToString(ViewState["sortDirection"]), Convert.ToString(ViewState["sortColumn"]));
     BindBottomPaging(ucPaging1, ucPaging);
 }
Beispiel #35
0
 protected void CarsGridView_Sorting(object sender, GridViewSortEventArgs e)
 {
     SortDirection sortDirection = SortingUtility.GetSortDirection(ViewState);
     ViewState[CarServiceConstants.SORT_DIRECTION_VIEW_STATE_ATTR] = sortDirection;
     ViewState[CarServiceConstants.SORT_EXPRESSION_VIEW_STATE_ATTR] = e.SortExpression;
     IQueryable<Automobile> automobiles = this.persister.GetAutomobiles();
     IQueryable<Automobile> sortedAutomobiles = SortingUtility.SortAutomobiles(automobiles, e.SortExpression, sortDirection);
     BindAutomobilesGrid(sortedAutomobiles);
 }
        protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
        {
            sql_object sql_obj = new sql_object();
            dataReader = sql_obj.get_offer_query();

            GridView1.DataSource = dataReader;
            GridView1.DataBind();
            sql_obj.close_connection();
        }
        // ////////////////////////////////////////////////////////////////////////
        // AUXILIAR EVENTS
        //
        protected void grdLiningPlan_Sorting(object sender, GridViewSortEventArgs e)
        {
            string direction = (e.SortDirection == SortDirection.Ascending) ? "ASC" : "DESC";

            DataView dataView = new DataView(raLiningPlanTDS.RaLiningPlan);
            dataView.Sort = e.SortExpression + " " + direction;
            grdLiningPlan.DataSource = dataView;
            grdLiningPlan.DataBind();
        }
 protected void GvSorting(object sender, GridViewSortEventArgs e) {
     if(String.Empty != _mStrSortExp) {
         if(String.Compare(e.SortExpression, _mStrSortExp, true) == 0) {
             _mSortDirection =
                 (_mSortDirection == SortDirection.Ascending) ? SortDirection.Descending : SortDirection.Ascending;
         }
     }
     ViewState["_Direction_"] = _mSortDirection;
     ViewState["_SortExp_"] = _mStrSortExp = e.SortExpression;
 }
        protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
        {
            GridView gv = (GridView)sender;
            gv.PageIndex = 0; //always sort to page 1

            GetSortDirection(e.SortExpression); //sort direction is always ascending, so we do this manually
            GridViewSortBy = e.SortExpression; //sortBy is stored so we can change direction next time

            PageAndBind(gv);
        }
 protected void GetCareersListSorted(Object sender, GridViewSortEventArgs e)
 {
     string strSortSQL = "select distinct j.OccName, j.OccNumber, count(pc.portfolioid) as TotalCount, sum(case when p.genderid=1 and active=1 then 1 else 0 end) as MaleCount, sum(case when p.genderid=0 and active=1 then 1 else 0 end) as FemaleCount";
     strSortSQL += " from PortfolioUserinfo p inner join Port_SavedCareers pc on p.portfolioID=pc.PortfolioID inner join JobInfoUS_EN j on pc.OccNumber=j.OccNUmber where p.State='MI' group by j.OccName, j.OccNumber ";
     strSortSQL += " order by " + e.SortExpression + " " + e.SortDirection.ToString().Substring(0,3);
     dtCareerList = CCLib.Common.DataAccess.GetDataTable(strSortSQL);
     Response.Write(strSortSQL);
     GridCareersList.DataSource = dtCareerList;
     GridCareersList.DataBind();
 }
Beispiel #41
0
 protected void grdPeformaceLoan_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
 {
     try
     {
         SortGridview(e);
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }
        protected void gvAttendees_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            if (!string.IsNullOrEmpty(ViewState["sortColumn"].ToString()) && ViewState["sortColumn"].ToString() == e.SortExpression)
            {
                ViewState["sortDirection"] = "DESC";
            }
            else
            {
                ViewState["sortDirection"] = "ASC";
            }
            ViewState["sortColumn"] = e.SortExpression;

            gvAttendees.DataSource = SortData();
            gvAttendees.DataBind();
        }
Beispiel #43
0
//INSTANT C# WARNING: Strict 'Handles' conversion only applies to 'WithEvents' fields declared in the same class - the event will be wired in 'SubscribeToEvents':
//ORIGINAL LINE: Protected Sub GridView1_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles GridView1.Sorting
    protected void GridView1_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
    {
        ViewState["Column"] = e.SortExpression;

        if (Convert.ToString(ViewState["Direction"]) == "Asc")
        {
            ViewState["Direction"] = "Desc";
        }
        else
        {
            ViewState["Direction"] = "Asc";
        }

        LoadData();
    }
Beispiel #44
0
 private void SortGridview(System.Web.UI.WebControls.GridViewSortEventArgs e)
 {
     try
     {
         dt = Session[clsConstant.SESS_TABLE] as DataTable;
         if (dt != null)
         {
             dt.DefaultView.Sort = e.SortExpression + " " + GetSortDirection(e.SortExpression);
             grdProjectPerformanceGroupCDetail.DataSource = Session[clsConstant.SESS_TABLE];
             grdProjectPerformanceGroupCDetail.DataBind();
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }
 public void SortGridview(System.Web.UI.WebControls.GridViewSortEventArgs e)
 {
     try
     {
         DataTable dataTable = Session[clsConstant.SESS_TABLE] as DataTable;
         if (dataTable != null)
         {
             dataTable.DefaultView.Sort = e.SortExpression + " " + GetSortDirection(e.SortExpression);
             grdDocSendList.DataSource  = Session[clsConstant.SESS_TABLE];
             grdDocSendList.DataBind();
             Session[clsConstant.SESS_TABLE] = dataTable;
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }
 private void SortGridview(System.Web.UI.WebControls.GridViewSortEventArgs e)
 {
     try
     {
         dt = new DataTable();
         dt = Session[clsConstant.SESS_TABLE] as DataTable;
         if (dt != null)
         {
             dt.DefaultView.Sort         = e.SortExpression + " " + GetSortDirection(e.SortExpression);
             grdContractAward.DataSource = Session[clsConstant.SESS_TABLE];
             grdContractAward.DataBind();
             Session[clsConstant.SESS_TABLE] = dt;
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }
        protected void gv_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            GridView gv = sender as GridView;

            //Retrieve the table from the session object.


            if (gv.ID == "gv_developers")
            {
                DataTable dt = Session["data_bulk_dev"] as DataTable;
                if (dt != null)
                {
                    //Sort the data.
                    dt.DefaultView.Sort      = e.SortExpression + " " + GetSortDirection(e.SortExpression);
                    gv_developers.DataSource = Session["data_bulk_dev"];
                    gv_developers.DataBind();
                }
            }

            if (gv.ID == "gv_contribs")
            {
                DataTable dt = Session["data_bulk_con"] as DataTable;
                if (dt != null)
                {
                    //Sort the data.
                    dt.DefaultView.Sort    = e.SortExpression + " " + GetSortDirection(e.SortExpression);
                    gv_contribs.DataSource = Session["data_bulk_con"];
                    gv_contribs.DataBind();
                }
            }

            if (gv.ID == "gv_awards")
            {
                DataTable dt = Session["data_bulk_awa"] as DataTable;
                if (dt != null)
                {
                    //Sort the data.
                    dt.DefaultView.Sort  = e.SortExpression + " " + GetSortDirection(e.SortExpression);
                    gv_awards.DataSource = Session["data_bulk_awa"];
                    gv_awards.DataBind();
                }
            }
        }
Beispiel #48
0
        protected void GridviewOPSRegions_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            string sortExpression = string.Empty;

            if ((SessionHandler.MappingOPSRegionSortOrder == " ASC"))
            {
                SessionHandler.MappingOPSRegionSortOrder     = " DESC";
                SessionHandler.MappingOPSRegionSortDirection = (int)App.BLL.Mappings.SortDirection.Descending;
                sortExpression = e.SortExpression.ToString() + SessionHandler.MappingOPSRegionSortOrder;
            }
            else
            {
                SessionHandler.MappingOPSRegionSortOrder     = " ASC";
                SessionHandler.MappingOPSRegionSortDirection = (int)App.BLL.Mappings.SortDirection.Ascending;
                sortExpression = e.SortExpression.ToString();
            }

            SessionHandler.MappingOPSRegionSortExpression = sortExpression.ToString();

            //Load Data
            GridviewSortingAndPaging(sortExpression);
        }
Beispiel #49
0
        protected void GridviewStatisticsDate_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            string sortExpression = string.Empty;

            if ((SessionHandler.AvailabilityStatisticsDateSortOrder == " ASC"))
            {
                SessionHandler.AvailabilityStatisticsDateSortOrder     = " DESC";
                SessionHandler.AvailabilityStatisticsDateSortDirection = (int)ReportStatistics.SortDirection.Descending;
                sortExpression = e.SortExpression.ToString() + SessionHandler.AvailabilityStatisticsDateSortOrder;
            }
            else
            {
                SessionHandler.AvailabilityStatisticsDateSortOrder     = " ASC";
                SessionHandler.AvailabilityStatisticsDateSortDirection = (int)ReportStatistics.SortDirection.Ascending;
                sortExpression = e.SortExpression.ToString();
            }

            SessionHandler.AvailabilityStatisticsDateSortExpression = sortExpression.ToString();

            //Generarte Report
            GridviewSortingAndPagingDate(sortExpression);
        }
Beispiel #50
0
    public static void CustomSorting(ref Telerik.Web.UI.RadGrid objDataGrid, System.Web.UI.WebControls.GridViewSortEventArgs e, System.Data.DataTable dt)
    {
        if (objDataGrid != null)
        {
            if (dt != null)
            {
                //DataGrid dgActivityStatus = ((System.Web.UI.WebControls.DataGrid)source);

                object strSort = objDataGrid.Attributes["SortExpression"];
                object strASC  = objDataGrid.Attributes["SortASC"];

                objDataGrid.Attributes["SortExpression"] = e.SortExpression;
                objDataGrid.Attributes["SortASC"]        = "Yes";
                if (Convert.ToString(e.SortExpression) == Convert.ToString(strSort))
                {
                    if (Convert.ToString(strASC) == "Yes")
                    {
                        objDataGrid.Attributes["SortASC"] = "No";
                    }
                    else
                    {
                        objDataGrid.Attributes["SortASC"] = "Yes";
                    }
                }

                DataView dv = dt.DefaultView;
                dv.Sort = objDataGrid.Attributes["SortExpression"];
                if (objDataGrid.Attributes["SortASC"] == "No")
                {
                    dv.Sort = dv.Sort + " " + "DESC";
                }


                objDataGrid.DataSource = dv;
                objDataGrid.DataBind();
            }
        }
    }
 protected void GridView1_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
 {
     //string StrSortDirection = "desc";
     //if (ViewState["Negahdari" + "Direction"] == null)
     //{
     //    ViewState.Add("Negahdari" + "Direction", "desc");
     //}
     //else
     //{
     //    StrSortDirection = CSharp.PublicFunction.secure(ViewState["Negahdari" + "Direction"].ToString());
     //}
     //if (StrSortDirection == "desc")
     //{
     //    StrSortDirection = "asc";
     //}
     //else
     //{
     //    StrSortDirection = "desc";
     //    ViewState["Negahdari" + "Direction"] = StrSortDirection;
     //}
     //ViewState["Negahdari"] = e.SortExpression + " " + StrSortDirection;
     //BindGrid();
 }
Beispiel #52
0
        protected void grdFrozenZone_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            List <FrozenZoneAcceptance> list = FrozenZoneAcceptance;

            //toggle sorting - note this toggle applies to all gridviews in the page
            if (Session["SortActivityDirection"] == null || Session["SortActivityDirection"].ToString() == "des")
            {
                Session["SortActivityDirection"] = "asc";
                e.SortDirection = SortDirection.Ascending;
            }
            else
            {
                Session["SortActivityDirection"] = "des";
                e.SortDirection = SortDirection.Descending;
            }

            list.Sort(new GenericSorter <FrozenZoneAcceptance>(e.SortExpression, e.SortDirection));

            Session["FrozenZoneAcceptance"] = list;

            grdFrozenZone.DataSource = list;
            grdFrozenZone.DataBind();
        }
Beispiel #53
0
        protected void gdvClientes_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            List <ClientesMod> listaGrid = new List <ClientesMod>();

            listaGrid = (List <ClientesMod>)Session["ListaGrid"];

            string _coluna = e.SortExpression;

            if (hidSortDirection.Value == "")
            {
                hidSortDirection.Value = e.SortDirection.ToString();
            }
            else
            {
                if (hidSortDirection.Value == SortDirection.Ascending.ToString())
                {
                    hidSortDirection.Value = SortDirection.Descending.ToString();
                }
                else
                {
                    hidSortDirection.Value = SortDirection.Ascending.ToString();
                }
            }

            if (e.SortExpression == "iCodigoCliente")
            {
                listaGrid.Sort(new OrderClientes(OrderClientes.SortType.iCodigoCliente, hidSortDirection.Value));
            }

            if (e.SortExpression == "sDescricao")
            {
                listaGrid.Sort(new OrderClientes(OrderClientes.SortType.sDescricao, hidSortDirection.Value));
            }

            gdvClientes.DataSource = listaGrid;
            gdvClientes.DataBind();
        }
Beispiel #54
0
        protected virtual void List_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            var grid = sender as GridView;

            if (grid == null)
            {
                throw new NotSupportedException("Standard sorting is supported only in GridViews.");
            }

            // Sort command will always start at the first page:
            grid.PageIndex = 0;

            // Update the module's new "Sort Expression" in ViewState so it is maintained in post backs.
            SortExpression = e.SortExpression;

            // Make sure the clicked sort column is now changed to DESC (or if it was DESC, it is now ASC):
            var currentSortColumn = grid.Columns.Cast <DataControlField>().FirstOrDefault(c => c.SortExpression == e.SortExpression);

            if (currentSortColumn != null)
            {
                if (e.SortExpression.EndsWith(" DESC"))
                {
                    currentSortColumn.SortExpression = e.SortExpression.TrimEnd(" DESC");
                }
                else
                {
                    currentSortColumn.SortExpression += " DESC";
                }
            }

            // Apply the sort logic:
            SortDataSource();

            // Set the GridView's new data source and bind it:
            grid.DataSource = FindGridSource(grid);
            grid.DataBind();
        }
Beispiel #55
0
        protected void GridView1_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            string StrSortDirection = "desc";

            if (ViewState["PercentHistory" + "Direction"] == null)
            {
                ViewState.Add("PercentHistory" + "Direction", "desc");
            }
            else
            {
                StrSortDirection = CSharp.PublicFunction.secure(ViewState["PercentHistory" + "Direction"].ToString());
            }
            if (StrSortDirection == "desc")
            {
                StrSortDirection = "asc";
            }
            else
            {
                StrSortDirection = "desc";
                ViewState["PercentHistory" + "Direction"] = StrSortDirection;
            }
            ViewState["PercentHistory"] = e.SortExpression + " " + StrSortDirection;
            BindGrid();
        }
        protected void GridView1_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
        {
            string StrSortDirection;

            if (ViewState["AgreementPercentID" + "Direction"] == null)
            {
                ViewState.Add("AgreementPercentID" + "Direction", "desc");
            }

            StrSortDirection = Securenamespace.SecureData.CheckSecurity(ViewState["AgreementPercentID" + "Direction"].ToString());

            if (StrSortDirection == "desc")
            {
                StrSortDirection = "asc";
            }
            else
            {
                StrSortDirection = "desc";
            }

            ViewState["AgreementPercentID" + "Direction"] = StrSortDirection;
            ViewState["AgreementPercentID"] = e.SortExpression + " " + StrSortDirection;
            BindGrid();
        }
Beispiel #57
0
 protected void dgvGridView_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
 {
     hdnSelectedIDs.Value    = "";
     ViewState["SortColumn"] = e.SortExpression;
     LoadDataGrid(false, true);
 }
Beispiel #58
0
 protected void InventoryTable_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
 {
     Debug.WriteLine("InventoryTable_Sorting");
     BindGrid(e.SortExpression, true);
 }
Beispiel #59
0
 void grd_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
 {
     state.SortDirection  = e.SortDirection;
     state.SortExpression = e.SortExpression;
 }
Beispiel #60
0
 protected void GridView1_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
 {
     //SqlFacility.SelectCommand = sqlPermitSelectCommand();
 }