The current findItemByText client-side function looks for items with exact text match. Is it possible to use it (or another function) more like a "StartsWith" function?
1 Answer, 1 is accepted
0
Ivana
Telerik team
answered on 23 Aug 2011, 07:40 AM
Hello Jc,
In order to achieve the desired functionality you should develop a custom method implementing it, there is no build in function available.
You can use JavaScript method indexOf to check if a text starts with a given string.
Using JavaScript you can find the RadListBox control by its ID, after that get the items of the RadListBox and make a loop over them to check if the text of an item contains the string given as an argument.
string.indexOf(searchstring, start) - returns -1 if no match is found.
*string - the string you search in (in our case item's text).
*searchstring - the string you are searching for.
*start - the position from which you want to start the searching (ex. if start=0 the searching starts from the first letter of the string).
Best wishes,
Ivana
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward!
We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>