Пример #1
0
        private void OnDataSourceViewSelectCallback(IEnumerable retrievedData)
        {
            DataView      defaultView   = retrievedData.ToDataTable(this).DefaultView;
            string        searchString  = HttpContext.Current.Request.QueryString["term"];
            DataFiltering dataFiltering = new DataFiltering();

            defaultView.RowFilter = dataFiltering.GetFilterExpression(this.SearchOperation, this.DataTextField, searchString, typeof(string));
            List <string> obj = defaultView.ToListOfString(this);

            HttpContext.Current.Response.SendResponse(new JavaScriptSerializer().Serialize(obj));
        }
Пример #2
0
        private string ConstructLinqFilterExpression(DataView view, JQGridSearchEventArgs args)
        {
            DataFiltering dataFiltering = new DataFiltering();

            if (view != null)
            {
                return(dataFiltering.GetLinqFilterExpression(args.SearchOperation, args.SearchColumn, args.SearchString, view.ToTable().Columns[args.SearchColumn].DataType));
            }
            JQGridColumn jQGridColumn = this._grid.Columns.FromDataField(args.SearchColumn);

            Guard.IsNull(jQGridColumn, "SearchColumn", string.Format("Colunm {0} not found in grid - search cannot proceed.", args.SearchColumn));
            Guard.IsNull(jQGridColumn.DataType, "DataType", "DataType for the respective column must be set in order to get custom search string (where clause)");
            return(dataFiltering.GetLinqFilterExpression(args.SearchOperation, args.SearchColumn, args.SearchString, jQGridColumn.DataType));
        }
Пример #3
0
 private void OnDataSourceViewSelectCallback(IEnumerable retrievedData)
 {
     DataView defaultView = retrievedData.ToDataTable(this).DefaultView;
     string searchString = HttpContext.Current.Request.QueryString["term"];
     DataFiltering dataFiltering = new DataFiltering();
     defaultView.RowFilter = dataFiltering.GetFilterExpression(this.SearchOperation, this.DataTextField, searchString, typeof(string));
     List<string> obj = defaultView.ToListOfString(this);
     HttpContext.Current.Response.SendResponse(new JavaScriptSerializer().Serialize(obj));
 }
Пример #4
0
 private string ConstructLinqFilterExpression(DataView view, JQGridSearchEventArgs args)
 {
     DataFiltering dataFiltering = new DataFiltering();
     if (view != null)
     {
         return dataFiltering.GetLinqFilterExpression(args.SearchOperation, args.SearchColumn, args.SearchString, view.ToTable().Columns[args.SearchColumn].DataType);
     }
     JQGridColumn jQGridColumn = this._grid.Columns.FromDataField(args.SearchColumn);
     Guard.IsNull(jQGridColumn, "SearchColumn", string.Format("Colunm {0} not found in grid - search cannot proceed.", args.SearchColumn));
     Guard.IsNull(jQGridColumn.DataType, "DataType", "DataType for the respective column must be set in order to get custom search string (where clause)");
     return dataFiltering.GetLinqFilterExpression(args.SearchOperation, args.SearchColumn, args.SearchString, jQGridColumn.DataType);
 }