protected void listViewSubStates_Sorting(object sender, ListViewSortEventArgs e)
        {
            // Check the sort direction to set the image URL accordingly.
            string imgUrl;

            if (e.SortDirection == SortDirection.Ascending)
            {
                imgUrl = "~/images/ascending.gif";
            }
            else
            {
                imgUrl = "~/images/descending.gif";
            }

            // Check which field is being sorted
            // to set the visibility of the image controls.
            Image sortImage1 = (Image)listViewSubStates.FindControl("SortImage1");
            Image sortImage2 = (Image)listViewSubStates.FindControl("SortImage2");

            switch (e.SortExpression)
            {
            case "SubStateRegionName":
                sortImage1.Visible  = true;
                sortImage1.ImageUrl = imgUrl;
                sortImage2.Visible  = false;
                break;

            case "Type":
                sortImage1.Visible  = false;
                sortImage2.Visible  = true;
                sortImage2.ImageUrl = imgUrl;
                break;
            }
        }
    protected void lvFriends_Sorting(object sender, ListViewSortEventArgs e)
    {
        Image  imgFirstName = (Image)lvFriends.FindControl("imgFirstName");
        Image  imgLastName  = (Image)lvFriends.FindControl("imgLastName");
        Image  imgCreated   = (Image)lvFriends.FindControl("imgCreated");
        String imageUrl     = (e.SortDirection == SortDirection.Ascending) ? "~/images/asc.gif" : "~/images/desc.gif";

        imgFirstName.Visible = false;
        imgLastName.Visible  = false;
        imgCreated.Visible   = false;

        switch (e.SortExpression)
        {
        case "firstname":
            imgFirstName.ImageUrl = imageUrl;
            imgFirstName.Visible  = true;
            break;

        case "lastname":
            imgLastName.ImageUrl = imageUrl;
            imgLastName.Visible  = true;
            break;

        case "created":
            imgCreated.ImageUrl = imageUrl;
            imgCreated.Visible  = true;
            break;
        }
    }
Example #3
0
        protected void lstEmployee_Sorting(object sender, ListViewSortEventArgs e)

        {
            e.Cancel             = true;
            ViewState["OrderBy"] = e.SortExpression;
            lstEmployee.DataBind();
        }
Example #4
0
        protected void ListViewEvents_Sorting(object sender, ListViewSortEventArgs e)
        {
            var allElever = UpdateDataSource();

            var sortDirection  = (SortDirection)Session["StillingsTypeList - SortDirection"];
            var sortExpression = Session["StillingsTypeList - SortExpression"].ToString();

            if (sortExpression == e.SortExpression)
            {
                if (sortDirection == SortDirection.Ascending)
                {
                    sortDirection = SortDirection.Descending;
                }
                else
                {
                    sortDirection = SortDirection.Ascending;
                }
            }
            else
            {
                sortDirection = SortDirection.Ascending;
            }

            Session["StillingsTypeList - SortDirection"]  = sortDirection;
            Session["StillingsTypeList - SortExpression"] = e.SortExpression;

            UpdateBinding(allElever, sort: true);
        }
Example #5
0
 protected void ListView1_Sorting(object sender, ListViewSortEventArgs e)
 {
     if (SortExpression == ("ASC"))
     {
         SortExpression = "DESC";
     }
     else
     {
         SortExpression = "ASC";
     }
 }
Example #6
0
 private void CurrentListView_Sorting(object sender, ListViewSortEventArgs e)
 {
     foreach (ViewColumn viewColumn in (CollectionBase)this.MyListView.CurrentListView.GetAdminView().Columns)
     {
         if (viewColumn.AllowSorting && string.Compare(viewColumn.GetSortExpression(), e.SortExpression, true) == 0)
         {
             this._StartRowIndex = 0;
             this.InitDataSource(this._StartRowIndex, this.GetMaximumRows(), true, e.SortExpression + " " + (e.SortDirection == SortDirection.Descending ? "DESC" : "ASC"));
         }
     }
 }
Example #7
0
        protected void lvFoundJobs_Sorting(object sender, ListViewSortEventArgs e)
        {
            string jobIdSort = "sortedOnJobId";

            // make first call on JobId descending
            if (e.SortExpression == "JobId")
            {
                if (ViewState[jobIdSort] == null || !(bool)ViewState[jobIdSort])
                {
                    e.SortDirection           = SortDirection.Descending;
                    this.ViewState[jobIdSort] = true;
                }
            }
        }
Example #8
0
        /// <summary>
        /// Handles the Sorting event of the CurrentListView control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.ListViewSortEventArgs"/> instance containing the event data.</param>
        void CurrentListView_Sorting(object sender, ListViewSortEventArgs e)
        {
            AdminView view = MyListView.CurrentListView.GetAdminView();

            foreach (ViewColumn column in view.Columns)
            {
                // find the column which is to be sorted
                if (column.AllowSorting && String.Compare(column.GetSortExpression(), e.SortExpression, true) == 0)
                {
                    // update DataSource parameters
                    string sortExpression = e.SortExpression + " " + (e.SortDirection == SortDirection.Descending ? "DESC" : "ASC");
                    LoadDataAndDataBind(sortExpression);
                }
            }
        }
Example #9
0
        protected void ListViewPlaylists_Sorting(object sender, ListViewSortEventArgs e)
        {
            e.Cancel = true;
            if (ViewState["OrderBy"] != null &&
                (string)ViewState["OrderBy"] == e.SortExpression)
            {
                this.changeDirection = true;
            }
            else
            {
                this.SortDirection = SortDirection.Ascending;
            }

            ViewState["OrderBy"] = e.SortExpression;
            this.ListViewPlaylists.DataBind();
        }
Example #10
0
        protected void HandleFieldItemSorting(object sender, ListViewSortEventArgs args)
        {
            List <DesignableField> fields = this.controller.DesignableForm.RelatedFields;
            ///sort the fields
            var sortedFields = fields;

            if (args.SortDirection == SortDirection.Ascending)
            {
                sortedFields = fields.OrderBy(field => field.Name).ToList();
            }
            else
            {
                sortedFields = fields.OrderByDescending(field => field.Name).ToList();
            }
            this.FieldsListView.DataSource = sortedFields;
            this.FieldsListView.DataBind();
        }
Example #11
0
        protected void SortListViewRecords(object sender, ListViewSortEventArgs e)

        {
            if (Session["dTable"] == null)
            {
                string sortExpression = e.SortExpression + " " + e.SortDirection;

                bind(sortExpression);
            }

            else
            {
                string sortExpression = e.SortExpression + " " + e.SortDirection;

                searchBind(sortExpression);
            }
        }
Example #12
0
        /// <summary>
        /// Handles the Sorting event of the CurrentListView control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.ListViewSortEventArgs"/> instance containing the event data.</param>
        void CurrentListView_Sorting(object sender, ListViewSortEventArgs e)
        {
            AdminView view = MyListView.CurrentListView.GetAdminView();

            foreach (ViewColumn column in view.Columns)
            {
                // find the column which is to be sorted
                if (column.AllowSorting && String.Compare(column.GetSortExpression(), e.SortExpression, true) == 0)
                {
                    // reset start index
                    _StartRowIndex = 0;

                    // update DataSource parameters
                    string sortExpression = e.SortExpression + " " + (e.SortDirection == SortDirection.Descending ? "DESC" : "ASC");
                    InitDataSource(_StartRowIndex, GetMaximumRows(), true, sortExpression);
                }
            }
        }
Example #13
0
        protected void lvClients_Sorting(object sender, ListViewSortEventArgs e)
        {
            string amountDueSort = "sortedOnAmountDue";
            string numJobsSort   = "numJobs";

            // make first call on Amount Due, # Jobs descending
            if (e.SortExpression == "AmountDue")
            {
                if (ViewState[amountDueSort] == null || !(bool)ViewState[amountDueSort])
                {
                    e.SortDirection = SortDirection.Descending;
                    this.ViewState[amountDueSort] = true;
                }
            }
            else if (e.SortExpression == "NumberOfJobs")
            {
                if (ViewState[numJobsSort] == null || !(bool)ViewState[numJobsSort])
                {
                    e.SortDirection             = SortDirection.Descending;
                    this.ViewState[numJobsSort] = true;
                }
            }
        }
        protected void lv_Sorting(object sender, ListViewSortEventArgs e)
        {
            LinkButton _lbChallanid    = _rprt.FindControl("_lbChallanid") as LinkButton;
            LinkButton _lbChallandDate = _rprt.FindControl("_lbChallandDate") as LinkButton;
            string     SortDirection   = "ASC";

            if (ViewState["SortExpression"] != null)
            {
                if (ViewState["SortExpression"].ToString() == e.SortExpression)
                {
                    ViewState["SortExpression"] = null;
                    SortDirection = "DESC";
                }
                else
                {
                    ViewState["SortExpression"] = e.SortExpression;
                }
            }
            else
            {
                ViewState["SortExpression"] = e.SortExpression;
            }
            retriveData(" order by " + e.SortExpression + " " + SortDirection);
        }
Example #15
0
 protected void ListView1_Sorting(object sender, ListViewSortEventArgs e)
 {
 }
 protected void OnSorting(object sender, ListViewSortEventArgs e)
 {
     // Nothing to do here. Method be present.
 }
Example #17
0
 protected void lstProductsBS3_Sorting(object sender, ListViewSortEventArgs e)
 {
     SortExpression            = e.SortExpression;
     lstProductsBS3.DataSource = Products;
     lstProductsBS3.DataBind();
 }
Example #18
0
 /// <summary>
 /// Sorting event, collapse all panels
 /// </summary>
 protected void OnSorting(object sender, ListViewSortEventArgs e)
 {
     closeAllSheets();
 }
        //public void LoadControlNonRev(object sender, FilterEvents e, int? currentPage, int? pageSize, string sortExpression)
        //{

        //}

        protected void ListViewNonRevOverview_Sorting(object sender, ListViewSortEventArgs e)
        {
        }
Example #20
0
 protected void ListViewActivities_Sorting(object sender, ListViewSortEventArgs e)
 {
 }
Example #21
0
        private void ApplyFilter(ListViewSortEventArgs e)
        {
            using (SomScDataContext context = new SomScDataContext())
            {
                int idCategoria = 0;
                if (!string.IsNullOrEmpty(CategoriaFilterComboBox.DataBindID))
                {
                    idCategoria = Convert.ToInt32(CategoriaFilterComboBox.DataBindID);
                }

                int idFornecedor = 0;
                if (!string.IsNullOrEmpty(FornecedorFilterComboBox.DataBindID))
                {
                    idFornecedor = Convert.ToInt32(FornecedorFilterComboBox.DataBindID);
                }

                IEnumerable <Com.Gt.SomSc.Domain.Entities.Saldo> saldos = context.GetCriticos(idCategoria, idFornecedor);

                if (e != null)
                {
                    switch (e.SortExpression)
                    {
                    case "Produto.Codigo":
                    {
                        if (e.SortDirection == SortDirection.Ascending)
                        {
                            saldos = saldos.OrderBy(s => s.Produto.Codigo);
                        }
                        else
                        {
                            saldos = saldos.OrderByDescending(s => s.Produto.Codigo);
                        }
                    }
                    break;

                    case "Produto.Descricao":
                    {
                        if (e.SortDirection == SortDirection.Ascending)
                        {
                            saldos = saldos.OrderBy(s => s.Produto.Descricao);
                        }
                        else
                        {
                            saldos = saldos.OrderByDescending(s => s.Produto.Descricao);
                        }
                    }
                    break;

                    case "Produto.Critico":
                    {
                        if (e.SortDirection == SortDirection.Ascending)
                        {
                            saldos = saldos.OrderBy(s => s.Produto.Critico);
                        }
                        else
                        {
                            saldos = saldos.OrderByDescending(s => s.Produto.Critico);
                        }
                    }
                    break;

                    case "Saldo":
                    {
                        if (e.SortDirection == SortDirection.Ascending)
                        {
                            saldos = saldos.OrderBy(s => s.Qtde);
                        }
                        else
                        {
                            saldos = saldos.OrderByDescending(s => s.Qtde);
                        }
                    }
                    break;

                    default:
                        break;
                    }
                }

                CriticosListView.DataSource = saldos;
                CriticosListView.DataBind();
            }
        }
Example #22
0
 protected void VendorListView_Sorting(object sender, ListViewSortEventArgs e)
 {
 }
Example #23
0
 protected override void OnSorting(ListViewSortEventArgs e)
 {
     RecordEvent("Enter");
     base.OnSorting(e);
     RecordEvent("Leave");
 }
Example #24
0
 protected void SaldosListView_Sorting(object sender, ListViewSortEventArgs e)
 {
     ApplyFilter(e);
 }
 protected void ListView1_Sorting(object sender, ListViewSortEventArgs e)
 {
     BindData(1, e.SortExpression, ViewState["search"] == null ? "" : ViewState["search"].ToString());
     ViewState["sort"]        = e.SortExpression;
     ViewState["currentPage"] = 1;
 }
Example #26
0
        private void ApplyFilter(ListViewSortEventArgs e)
        {
            using (SomScDataContext context = new SomScDataContext())
            {
                IEnumerable <Com.Gt.SomSc.Domain.Entities.Saldo> saldos = context.GetSaldos();

                if (!string.IsNullOrEmpty(ProdutoFilterComboBox.DataBindID) && !string.IsNullOrEmpty(FilialFilterComboBox.DataBindID))
                {
                    saldos = saldos.Where(s => s.Produto.Id == Convert.ToInt32(ProdutoFilterComboBox.DataBindID) && s.Filial.Id == Convert.ToInt32(FilialFilterComboBox.DataBindID));
                }
                else if (!string.IsNullOrEmpty(ProdutoFilterComboBox.DataBindID))
                {
                    saldos = saldos.Where(s => s.Produto.Id == Convert.ToInt32(ProdutoFilterComboBox.DataBindID));
                }
                else if (!string.IsNullOrEmpty(FilialFilterComboBox.DataBindID))
                {
                    saldos = saldos.Where(s => s.Filial.Id == Convert.ToInt32(FilialFilterComboBox.DataBindID));
                }

                if (e != null)
                {
                    switch (e.SortExpression)
                    {
                    case "Produto.Codigo":
                    {
                        if (e.SortDirection == SortDirection.Ascending)
                        {
                            saldos = saldos.OrderBy(s => s.Produto.Codigo);
                        }
                        else
                        {
                            saldos = saldos.OrderByDescending(s => s.Produto.Codigo);
                        }
                    }
                    break;

                    case "Produto.Descricao":
                    {
                        if (e.SortDirection == SortDirection.Ascending)
                        {
                            saldos = saldos.OrderBy(s => s.Produto.Descricao);
                        }
                        else
                        {
                            saldos = saldos.OrderByDescending(s => s.Produto.Descricao);
                        }
                    }
                    break;

                    case "Filial.Nome":
                    {
                        if (e.SortDirection == SortDirection.Ascending)
                        {
                            saldos = saldos.OrderBy(s => s.Filial.Nome);
                        }
                        else
                        {
                            saldos = saldos.OrderByDescending(s => s.Filial.Nome);
                        }
                    }
                    break;

                    case "Saldo":
                    {
                        if (e.SortDirection == SortDirection.Ascending)
                        {
                            saldos = saldos.OrderBy(s => s.Qtde);
                        }
                        else
                        {
                            saldos = saldos.OrderByDescending(s => s.Qtde);
                        }
                    }
                    break;

                    default:
                        break;
                    }
                }

                SaldosListView.DataSource = saldos;
                SaldosListView.DataBind();
            }
        }
Example #27
0
 protected void ListViewArticles_Sorting(object sender, ListViewSortEventArgs e)
 {
     e.Cancel = true;
     this.ViewState["orderByExpression"] = e.SortExpression;
     this.ListViewArticles.DataBind();
 }
Example #28
0
        /// <summary>
        /// ListView Item Sorting event
        /// </summary>
        /// <param name="fxEventArgs"></param>
        /// <param name="e"></param>
        /// <returns></returns>
        protected string UOC_lvwListView1_Sorting(FxEventArgs fxEventArgs, ListViewSortEventArgs e)
        {
            // 元のデータ
            DataTable dt1 = (DataTable)Session["SampleData"];

            // ソート後のデータを格納するためのDataTable
            DataTable dt2 = dt1.Clone();

            // データソート用のDataView
            DataView dv = new DataView(dt1);

            if (Session["SortDirection"] == null)
            {
                // ソートの定義情報を格納するためのDictionaryがない場合は作成する
                Session["SortDirection"] = new Dictionary <string, SortDirection>();
            }

            // ソート定義情報にしたがい、データをソートする
            if (!((Dictionary <string, SortDirection>)Session["SortDirection"]).ContainsKey(e.SortExpression))
            {
                // ソート定義情報がない場合。デフォルトは昇順とする
                dv.Sort = e.SortExpression;

                // ソート定義情報を追加する
                ((Dictionary <string, SortDirection>)Session["SortDirection"]).Add(e.SortExpression, SortDirection.Descending);
            }
            else
            {
                // ソート定義情報をもとに、当該列のソート方向を取得する
                SortDirection direction = ((Dictionary <string, SortDirection>)Session["SortDirection"])[e.SortExpression];

                if (direction == SortDirection.Ascending)
                {
                    // 昇順
                    dv.Sort = e.SortExpression;

                    // ソート定義情報を更新する
                    ((Dictionary <string, SortDirection>)Session["SortDirection"])[e.SortExpression] = SortDirection.Descending;
                }
                else
                {
                    // 降順
                    dv.Sort = e.SortExpression + " DESC";

                    // ソート定義情報を更新する
                    ((Dictionary <string, SortDirection>)Session["SortDirection"])[e.SortExpression] = SortDirection.Ascending;
                }
            }

            // ソート後のデータをDataTableにインポートする
            foreach (DataRowView drv in dv)
            {
                dt2.ImportRow(drv.Row);
            }

            // データの再バインド
            Session["SampleData"] = dt2;
            this.BindListViewData();

            return("");
        }
Example #29
0
 protected void ListView1_Sorting(object sender, ListViewSortEventArgs e)
 {
     //this cannot be deleted , to handle the sorting event
 }
Example #30
0
 protected void LvSorting(object sender, ListViewSortEventArgs args)
 {
     // this.SqlDataSource1.OrderGroupsBy = string.Format("Key {0}", args.SortDirection);
 }