Coordinator
May 1, 2012 at 9:39 AM
Edited May 1, 2012 at 9:45 AM
|
As you use any other helper....
<%: filter.DropDownFor(m => m.MySelection.....
Where MySelection is a property you have to define in your general filter an that will contain the value of the selected item. Then you use the MySelection in your FilterBuilder to define a filtering condition based on it,
The point is that you defined just Categories....that is the list of all possible selections...what you have to put in your filter is the selected item that you define like this:
<%: filter.DropDownFor(m => m.MySelection.....
That is you use filter as the normal Html of your view....but
filter will propose you the properties you defined in your general filter instead of the ones defined in the ViewModel of your View. This will cause the values of the controls to be bound to the properties of your general filter...then you can process
them with the help of the FilterBuilder class. please download the BasicTutorialCode filein the
download area. It contains examples of building a filter based either on the GenerraFilter or on The FilterClauseFor helper or on a mix of them
|