SPKan
SPKan

Reputation: 555

Custom Filtering with Like Keyword-GridView

I am using custom SPgridview with Filtering, and Sorting. In Filtering for the Query I have used has a condition as follows.

" AND SupplierActiveStatus LIKE '%{0}%'"

This has two values in DB. "Active" or "Inactive". This filter applies perfectly when you filter by Inactive. Due to "like" condition for the Active users it shows both types of uses without Filtering.

Please help me to find the correct filter expression to equal two strings.

Thanks in Advance.

Upvotes: 0

Views: 185

Answers (1)

Garrison Neely
Garrison Neely

Reputation: 3289

Why not get rid of the LIKE and just say:

AND SupplierActiveStatus = '{0}'

Since you have only two statuses, there's no reason to match on a wildcard with LIKE

Upvotes: 1

Related Questions