i Have Kendo ui Grid In My Project (client side) and in my grid FilterAble and Sortable and ... is true and set on serverSide operation
but my database is mongodb and now when in my client user set filter i got this error
An exception of type 'System.InvalidOperationException' occurred in MongoDB.Driver.dll but was not handled in user code Additional information: Compare({document}{Name}.ToLower(), "test") is not supported.
because i use webapi i Create My own DataSourceRequest Class without inheritance when i want convert my own class to DataSourceRequest with this method(for filterAble )
if (model.Filter != null && model.Filter.Filters.Count > 0)
{
var filters = new FilterDescriptorCollection();
foreach (var f in model.Filter.Filters)
{
FilterDescriptor filter = new FilterDescriptor()
{
Member = f.Field,
Operator =(FilterOperator)f.Operator,
Value = f.Value
};
filters.Add(filter);
}
request.Filters = filters;
}
this my repository
var result = _context.Additives.AsQueryable().Select(a => new AdditiveList()
{
Id = a.Id.DbId,
Name = a.Name,
CurrentWeight = a.CurrentWeight,
InitialWeight = a.InitialWeight
}).ToDataSourceResult(model.ToDataSourceRequest());
now i have this question i was wrong for filter Creating ? or kendo dont support mongo operation and i must write this for myself?
tnks
Compare({document}{Name}.ToLower(), "test")? May you put that block of code in your project include this part (Compare({document}{Name}.ToLower(), "test")in your question? - RAMnamewithNULLvalue in theAdditives? Try fill all of thenamefield values with some data else null and test again. Do you see the error after apply these changes? - RAM