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

[Solved] MVC Grid setting an initial filter function without filtering

1 Answer 96 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.
andreas
Top achievements
Rank 1
andreas asked on 31 May 2011, 05:07 PM
Hi all,

when a filterable grid is shown users may open the filter dialog for a column by clicking on the filter icon. In this filter dialog the default filter function is set to "is Equal" but I'd like it to be "Starts with" for all columns.

How can this be set?

Just to make it clear: I do not want to apply any Filter unless the user enters one. I just want to set the default filter function to "Starts with" so users don't need to change this, because this is the most liked filter method. It also allows users to enter their filter criteria and hit the enter key to apply that filter without editing the filter mode by mouse.

Thank you
kind regards
Andreas

1 Answer, 1 is accepted

Sort by
0
andreas
Top achievements
Rank 1
answered on 01 Jun 2011, 09:54 AM
Hi all

One day later:
I got it by setting an empty filter with the desired filter mode like this:
.Filterable( a => a.Filters(b => b.Add(c => 
c.ProjektName).StartsWith("").And().StartsWith("")))
The only problem with this solution is: The column headers filter symbol is looking like there were a filter active.
Is there a way to set the filter mode without applying a filter?

regards
Andreas

Tags
Grid
Asked by
andreas
Top achievements
Rank 1
Answers by
andreas
Top achievements
Rank 1
Share this question
or