Exemplo n.º 1
0
 protected virtual void OnSorting(JQGridSortEventArgs e)
 {
     bool isBoundUsingDataSourceID = base.IsBoundUsingDataSourceID;
     JQGridSortEventHandler handler = (JQGridSortEventHandler)base.Events[EventSorting];
     if (handler != null)
     {
         handler(this, e);
     }
     //else if (!isBoundUsingDataSourceID && !e.Cancel)
     //{
     //    throw new HttpException("Unhandled event");
     //}
 }
Exemplo n.º 2
0
 private void PerformSort(DataView view, string sortExpression, string sortDirection)
 {
     if (!String.IsNullOrEmpty(sortExpression))
     {
         JQGridSortEventArgs args = new JQGridSortEventArgs(sortExpression, sortDirection);
         OnSorting(args);
         if (!args.Cancel)
         {
             view.Sort = String.Format("{0} {1}", sortExpression, sortDirection);
         }
         OnSorted(new EventArgs());
     }
 }
Exemplo n.º 3
0
 protected virtual void OnSorting(JQGridSortEventArgs e)
 {
     bool arg_06_0 = base.IsBoundUsingDataSourceID;
     JQGrid.JQGridSortEventHandler jQGridSortEventHandler = (JQGrid.JQGridSortEventHandler)base.Events[JQGrid.EventSorting];
     if (jQGridSortEventHandler != null)
     {
         jQGridSortEventHandler(this, e);
     }
 }
Exemplo n.º 4
0
 private void PerformSort(DataView view, string sortExpression, string sortDirection)
 {
     if (!string.IsNullOrEmpty(sortExpression))
     {
         JQGridSortEventArgs jQGridSortEventArgs = new JQGridSortEventArgs(sortExpression, sortDirection);
         this.OnSorting(jQGridSortEventArgs);
         if (!string.IsNullOrEmpty(jQGridSortEventArgs.NewSortExpression))
         {
             view.Sort = jQGridSortEventArgs.NewSortExpression;
         }
         else
         {
             if (!jQGridSortEventArgs.Cancel && view.Count > 0)
             {
                 view.Sort = this.GetSortExpression(sortExpression, sortDirection);
             }
         }
         this.OnSorted(new EventArgs());
     }
 }
Exemplo n.º 5
0
 protected override DataSourceSelectArguments CreateDataSourceSelectArguments()
 {
     Convert.ToInt32(this.QueryString["page"]);
     Convert.ToInt32(this.QueryString["rows"]);
     string text = this.QueryString["sidx"];
     string sortDirection = this.QueryString["sord"];
     string search = this.QueryString["_search"];
     string arg_6F_0 = this.QueryString["parentRowID"];
     if (this._filteredGridState != null)
     {
         ExportDataRange arg_85_0 = this.ExportSettings.ExportDataRange;
     }
     DataSourceSelectArguments dataSourceSelectArguments = new DataSourceSelectArguments();
     DataSourceView data = this.GetData();
     if (data is LinqDataSourceView)
     {
         LinqDataSourceView linqDataSourceView = data as LinqDataSourceView;
         linqDataSourceView.Where = this.GetWhereClause(search, true);
     }
     if (data.CanSort && !string.IsNullOrEmpty(text))
     {
         JQGridSortEventArgs jQGridSortEventArgs = new JQGridSortEventArgs(text, sortDirection);
         this.OnSorting(jQGridSortEventArgs);
         this._dataSourceSorted = true;
         if (!jQGridSortEventArgs.Cancel)
         {
             dataSourceSelectArguments.SortExpression = this.GetSortExpression(text, sortDirection);
         }
     }
     if (data.CanPage)
     {
         if (data.CanRetrieveTotalRowCount)
         {
             dataSourceSelectArguments.RetrieveTotalRowCount = true;
             dataSourceSelectArguments.MaximumRows = this.PagerSettings.PageSize;
         }
         else
         {
             dataSourceSelectArguments.MaximumRows = -1;
         }
         dataSourceSelectArguments.StartRowIndex = this.PagerSettings.PageSize * (this.PagerSettings.CurrentPage - 1);
     }
     return dataSourceSelectArguments;
 }