FieldLikePredicate

Posts   
 
    
dmbaer
User
Posts: 2
Joined: 02-Nov-2007
# Posted on: 05-Nov-2007 21:29:54   

I have a datasource that is bound to a formview on my webform. I'd like to have an id search box where you can type in an ID and it will give you a set of all customers where the ID field starts with whatever you type in. Since I can't use wild cards in the SelectParameters property, I've tried to set the FilterToUse property in the page_load function. I can set it fine when the page first loads, but I can't seem to bind the predicate that I use to make my filter to a control (id search text box) on my page. Any ideas? here is my code:

protected void Page_Load(object sender, EventArgs e) {

PredicateExpression filter = new PredicateExpression(); CustomerDataSource.FilterToUse = filter; CustomerDataSource.FilterToUse.Add(new FieldLikePredicate(CustomerFields.Id, "" + IDSearch.Text + "%"));

}

Everytime I enter anything into the id search box, the page load method is called again, but I can't figure out why the filter isn't being applied the second time around?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 06-Nov-2007 04:22:36   

Hi dmbaer,

Similiar issue and solution is discussed here http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=8897

David Elizondo | LLBLGen Support Team