This is a migrated thread and some comments may be shown as answers.

[Solved] Google Like Filtering In RadGrid

2 Answers 137 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Monalisa
Top achievements
Rank 1
Monalisa asked on 26 Oct 2009, 07:14 AM
Hi Telerik,

I use the Google Like filtering in my application. It works fine. But I need small changes.
When I first click on the Filter textbox, it loads everything from database and shows it in a Combo.
What I need is at the time of first click on the textbox it should not select any thing from database, because  there is heavy load to server, after typing something in that textbox then it should select from database.

So, how to do this. Please suggest.

Thanks,
Monalisa

2 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 28 Oct 2009, 01:14 PM
Hello Monalisa,

To avoid the loading of items when no value is typed in the RadComboBox input area, consider modfying the OnItemsRequested event handler of the combo in the MyCustomFilteringColumnCS.cs file of the relevant demo as follows:

private void list_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
{
   if(e.Text != String.Empty)
   {
    ((RadComboBox)o).DataTextField = this.DataField;
    ((RadComboBox)o).DataValueField = this.DataField;
    ((RadComboBox)o).DataSource = GetDataTable("SELECT DISTINCT " + this.UniqueName + " FROM Customers WHERE " + this.UniqueName + " LIKE '" + e.Text + "%'");
    ((RadComboBox)o).DataBind();
   }
}

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Monalisa
Top achievements
Rank 1
answered on 28 Oct 2009, 01:28 PM
Hi Sebastian,

Thank you very much for your support, it's working fine.

Thanks,
Monalisa
Tags
Grid
Asked by
Monalisa
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Monalisa
Top achievements
Rank 1
Share this question
or