I have a LinqDataSource bound to ASp.Net GridView which simple displays a table's data in the grid. I have a search button and its code behind like this:
protected void search_Click(object sender, EventArgs e)
if (textOrderNumber.Text.Trim() != "")
LinqDataSourceOrders.Where = "OrderNumber = " + textOrderNumber.Text;
This works fine most of the times and it filters the Orders based on order number entered in the text box. The problem is: Sometimes, you have to click search button twice to see the results! My code is really simple and thats all it does what I told you here.
First time you press search, nothing shows! Second time you press search, the related rows appear in the grid!
I am using designer to bind the LinqDataSource to the GridView ... and its simple binding with all default values.
Any ideas what could be wrong? Or how would you do this type of filtering?