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();
        }
Exemple #2
0
    protected void gridCar_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 sort direction
            switch (currentSortDirection.ToUpper())
            {
            case "ASC":
                this.SortExpression = currentSortColumn + " DESC";
                break;

            case "DESC":
                this.SortExpression = currentSortColumn + " ASC";
                break;
            }
        }
        else
        {
            this.SortExpression = e.SortExpression + " ASC";
        }
        //load the data with this SortExpression and DataBind the Grid
        BindGrid();
    }
Exemple #3
0
 protected void LV2_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
 {
     this.L.Text = "";
     if (e.SortDirection.ToString().Substring(0, this.EventsSort.Length).ToUpper() == EventsSort)
     {
         EventsSort = "DESC";
     }
     else
     {
         EventsSort = "ASC";
     }
     try
     {
         var list = new Events(this.LegalCase, true).ItemsFiltered;
         for (int i = 2; i < this.LV2.Columns.Count; i++)
         {
             this.LV2.Columns.Remove(this.LV2.Columns[i]);
         }
         this.LV2.DataSource = list.Select("", e.SortExpression + " " + EventsSort).CopyToDataTable();
         this.LV2.DataBind();
     }
     catch (ValidationException validationException)
     {
         this.L.Text = this.L.Text + validationException.Message + newLine;
     }
     catch (Exception exception)
     {
         this.L.Text = this.L.Text + exception.Message + newLine;
     }
 }
Exemple #4
0
 /// <summary>
 ///  Get sorted results by input sortexpression and sortdirection.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void GVSorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
 {
     try
     {
         this.GridViewDataBind(_presenter.Sorting(e.SortExpression.ToString()));
     }
     catch (Exception ex)
     {
         this.ShowErrorMessage(ex);
     }
 }
Exemple #5
0
 /// <summary>
 /// Evento Producido al Cambiar el Indice de Ordenamiento
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void gvConceptosFacturaConcepto_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
 {     //Validando que existan los DataKeys
     if (gvConceptosFacturaConcepto.DataKeys.Count > 0)
     { //Limpiando Controles
         limpiaControlesConcepto();
         //Asignando Orden de Registros
         this._dtConceptos.DefaultView.Sort = lblOrdenado.Text;
         //Cambiando Ordenamiento del GridView
         lblOrdenado.Text = TSDK.ASP.Controles.CambiaSortExpressionGridView(gvConceptosFacturaConcepto, this._dtConceptos, e.SortExpression, true, 3);
         //Mostrando Totales
         escribeTotales();
     }
 }
Exemple #6
0
 protected void gvLogs_Sorting(object sender, System.Web.UI.WebControls.GridViewSortEventArgs e)
 {
     UpdateSorting(e.SortExpression);
     LoadLogs();
 }