So I have two filtering objects. One is a drop down list, which chooses the group of users to look at. Next is the user search box. I would like to use this to filter the results further so that you can search for a user in the chosen group.
I have tested the group filter and it works on it’s own (without the inclusion of the searchbox).
Now, the problem I face is the default view. What I want to also be able to do is choose a group without putting in a user, giving me the complete list of users in that group. Then if I want to filter it down more I would use the searchbox.
Currently I have to use the searchbox in order to have any results show. I suspect it’s the default value I have set for the searchbox control parameter, but I am unsure how to fix it (I have tried putting the wildcard in but then it doesn’t filter by group anymore)
Here is the filter expression:
FilterExpression="(([Field1] = {0}) AND ([Field2] LIKE '%{1}%'))"
And here are the parameters:
<FilterParameters>
<asp:ControlParameter ControlID="DDL" Name="Field1"
PropertyName="SelectedValue"
Type="Int32" />
<asp:ControlParameter ControlID="SearchBox" Name="Field2"
Type="String" />
</FilterParameters>
<SelectParameters>
<asp:ControlParameter ControlID="DDL" Name="Field1" PropertyName="SelectedValue" Type="Int32" />
<asp:ControlParameter ControlID="SearchBox" Name="Field2" Type="String" DefaultValue="" />
</SelectParameters>
Any help would be greatly appreciated!
Put default value as “” in filter parameter for search box.