5 Answers, 1 is accepted
0
Hello Water,
You could use the set_filter() client-side function, in order to apply a desirable filter. The function accepts tree values as arguments :
Regards,
Nencho
Telerik
You could use the set_filter() client-side function, in order to apply a desirable filter. The function accepts tree values as arguments :
- 0 : filter - None
- 1 : filter - Contains
- 2 : filter - StartsWith
Regards,
Nencho
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Water
Top achievements
Rank 1
answered on 03 Dec 2013, 12:44 PM
Thanks for that. I created a function using the set_filter method however this only seems to effect what text is highlighted in the search results, rather than what search results are returned, am I missing something?
function
SetComboBoxSearchFilter(comboBoxClientId, filterNumber)
{
var
comboBox = $find(comboBoxClientId);
comboBox.set_filter(filterNumber);
if
(comboBox.get_text() !=
''
&& comboBox.get_text() != comboBox.get_emptyMessage())
{
comboBox.clearItems();
comboBox.requestItems(comboBox.get_text(),
false
);
}
}
0
Hello Water,
I tried the approach that you are currently using and it seems to work properly. Here is a video, demonstrating the behavior at my end, when the StartsWith(2) is used. I noticed that you are using
Regards,
Nencho
Telerik
I tried the approach that you are currently using and it seems to work properly. Here is a video, demonstrating the behavior at my end, when the StartsWith(2) is used. I noticed that you are using
requestItems
function. Had you enabled the LoadOnDemand functionality? In this case, I would suggest you to implement the filter at server-side, like demonstrated in our online demo here. Passing the currently typed text in the input of the ComboBox, you could then easily filter the query returned for your datasource, like demonstrated in the SourceCode of the referenced demo (Product ComboBox).Regards,
Nencho
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Water
Top achievements
Rank 1
answered on 09 Dec 2013, 10:29 AM
Yes, I am using Load On Demand. Would this prevent the client side method from working correctly? In any case, I have the server side method working, I was just trying to reduce the number of postbacks.
0
Hello Water,
Would you provide us with your entire implementation of the RadComboBox and specify how do you attempt to reduce the number of postbacks? By default the ItemsRequested event is fired each time a character is typed in the input of the control. Do you cancel the propagation of the event, in order to implement custom logic?
Regards,
Nencho
Telerik
Would you provide us with your entire implementation of the RadComboBox and specify how do you attempt to reduce the number of postbacks? By default the ItemsRequested event is fired each time a character is typed in the input of the control. Do you cancel the propagation of the event, in order to implement custom logic?
Regards,
Nencho
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.