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

[Solved] Manipulation of what the 'Linq-based expression engine' feeds

1 Answer 23 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Christian Setzkorn
Top achievements
Rank 1
Christian Setzkorn asked on 14 Oct 2011, 10:20 AM

Hi,

I really love the 'Linq-based expression engine'. It makes my live as developer really easy for filtering, sorting and paging.

I am just wondering whether it is possible to manipulate the linq code for a column. I have this situation:

My Item class contains these properties:

public virtual Word ItemName { get; set; }
public virtual IList<Word> AlternativeItemNames { get; set; }

Where Word looks like this:

public class Word : Entity
{
...
public virtual string Text { get; set; }
...
}

The ItemName is the ‘main word’ of the Item and I can filter by this very good using ‘starts with’ etc.

I would really like to filter for Items where:

- The ‘main word’ OR AlternativeItemNames start with something, are equal etc.

Is this easily possible?

I know how to intercept the GridCommand at, for example, the data access/repository level. Maybe there is another easier way? Maybe I can define something at a higher level to change what the Linq-based expression engine feeds in (e.g. even in the view)?

Thanks.

Best wishes,

Christian


1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 17 Oct 2011, 09:22 AM
Hello Christian Setzkorn,

I'm afraid that the requested functionality is not supported as built-in feature. In order to implement this you should use custom binding. A possible implementation will be to either intercept the grid command and modify the filter descriptor for the column (if such exists) to add the additional filter or implement an additional logic in you custom binding routine to handle the additional filter.

All the best,
Rosen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
Christian Setzkorn
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or