I think Hristo
Valyavicharski's suggestion is the right direction.
Recently, I have
implemented SearchBox with the following way, and it is working very well so
far. I'am posting it here for your reference.
First, you should
set DataSource for SearchBox with an empty list of objects inside Page_Load or
Page_Init event, such as:
//This is just an empty list
= new List<EmployeeName>();
This is just to
prevent SearchBox from showing "DataSource not sets" error popup when
its DataSource is not set. No need to
call DataBind() here. This means that the SearchBox is initially loaded with no data,
hence good performance on load.
You can use DataSourceSelect event of SearchBox, and I
would suggest you use a method to filter records from the database. I'am
using full-text search. It would be something like this:
sender, SearchBoxDataSourceSelectEventArgs e)
//This is search string User types into Input of SearchBox
var searchQuery = e.FilterString.Trim();
//Use your search method here to filter records from the database
//Should also set MaximumRows (or PageSize) as paging for better performance
//And any other parameter as desired
DataSource = YourFullTextSearchMethod(searchQuery [, startRowIndex, maximumRows]);
If you use search on
demand feature, I suggest you set a request delay to prevent SearchBox from sending request with every single character
can be implemented by setting OnClientLoad
event of SearchBox.
And the Js function:
//This works with RadSearchBox, RadAutoCompleBox
sender._requestDelay = 800;
Hope this helps.