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?