Jump to: navigation, search

Changes


HowTo:Implement Custom Filtering

32 bytes removed, 30 July
/* Comparison */
For range comparison, we use the [https://learn.microsoft.com/en-us/dotnet/api/system.string.compareto?view=net-9.0 Microsoft .CompareTo method]. As documented there, this method outputs a -1/0/1 depending on the compared string's location in the range. Our expression can target one output for an 'exclusive' filter (in which the inputted date is not considered for the range), however, a more likely scenario is that the user wants the inputted date included in the filter. This is why the expression in the StringFormatConverter should be defined for start date as !=-1, and for end date as !=1; the instance should be not less than than the start date (where true would be an output of 0 or 1), and not greater than the end date (true = -1 or 0), respectively.
Similar to the earlier section on [[HowTo:Implement_Custom_Filtering#Multiple_Dynamic_.28User_Inputs.29_Criteria|multiple inputs]], separate EvalExpressions are used for each half of the range, meaning that the filtering also works (as an 'open Range' filter) when only one value is inputted by the user. If To implement only an open range filter is all that is required by the usecase, simply eliminate the second input and EvalExpression can simply be eliminated.
<tabs>
696
edits