This is a migrated thread and some comments may be shown as answers.

how create predicate from grid filters

0 Answers 51 Views
GridView
This is a migrated thread and some comments may be shown as answers.
tuan
Top achievements
Rank 1
tuan asked on 25 May 2011, 05:35 AM
hi!,

In silverlight, how can i create predicate from grid filters. ( I can FilterDescriptors)
 
I read http://www.telerik.com/community/forums/silverlight/gridview/lamba-predicate-from-grid-filters.aspx but I can not it

public static IQueryable Where(this IQueryable source, IEnumerable<IFilterDescriptor> filterDescriptors)
        {
            if (filterDescriptors.Count() > 0)
            {
                var parameterExpression = Expression.Parameter(source.ElementType, "item");
  
                var expressionBuilder = new FilterDescriptorCollectionExpressionBuilder(parameterExpression, filterDescriptors);
                var predicate = expressionBuilder.CreateFilterExpression();
                return source.Where(predicate);
            }
  
            return source;
        }

but FilterDescriptorCollectionExpressionBuilder unavailable in silverlight.

No answers yet. Maybe you can help?

Tags
GridView
Asked by
tuan
Top achievements
Rank 1
Share this question
or