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

Highlight filtered results with entered text

2 Answers 71 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sanjay
Top achievements
Rank 1
Sanjay asked on 12 Nov 2010, 07:00 PM
For some reason I am not able to Highlight filtered results with entered text in the RadComboBox!

I am able to see all the data and also filter but can't get the

If I type jo in the box I want to see the record John Smith  with "Jo" bolded and highlighted ?
Here is my aspx and JS below:

<

 

telerik:RadComboBox ID="rcbUser" runat="server" AllowCustomText="false" DropDownWidth="300px"

 

 

EmptyMessage="Enter a hint or Select Employee" EnableLoadOnDemand="true" EnableTextSelection="false"

 

 

Height="200px" HighlightTemplatedItems="true" OnItemDataBound="rcbUser_ItemDataBound" Filter="Contains"

 

 

OnItemsRequested="rcbUser_ItemsRequested" SkinID="ddRegular" ToolTip="Enter a hint or Select Employee"

 

 

Width="200px" EnableVirtualScrolling="true" OnClientItemsRequesting="OnClientItemsRequesting"

 

 

ShowMoreResultsBox="true" ItemsPerRequest="15">

 

 

<HeaderTemplate>

Client Script:

 

 

<script type="text/javascript">

 

 

 

 

 

//on upload button click temporarily disables ajax to perform upload actions

 

 

 

 

 

function conditionalPostback(sender, args) {

 

 

if (args.EventTarget == "<%= btnCreate.UniqueID %>") {

 

args.EnableAjax =

false;

 

}

}

 

function OnClientItemsRequesting(sender, eventArgs) {

 

 

var context = eventArgs.get_context();

 

context[

"FilterString"] = eventArgs.get_text();

 

 

 

// if (sender.get_text().length < 2) {

// eventArgs.set_cancel(true);

// }

// //Highlight the matches based on the combobox text

 

 

 

sender.highlightAllMatches(eventArgs.get_text());

 

if (sender.get_items().get_count() > 0)

 

sender.get_items().getItem(0).highlight();

}

 

 

</script>

 

 

 

2 Answers, 1 is accepted

Sort by
0
Sanjay
Top achievements
Rank 1
answered on 15 Nov 2010, 04:20 PM
Hello,
Is anybody there to help?
It is more than 2 days!!!
0
Accepted
Simon
Telerik team
answered on 16 Nov 2010, 04:00 PM
Hi Sanjay,

The filtering functionality, enabled with the Filter property, does not work with ItemTemplate. We will consider implementing in the future though. You can vote for it here.

Kind regards,
Simon
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
ComboBox
Asked by
Sanjay
Top achievements
Rank 1
Answers by
Sanjay
Top achievements
Rank 1
Simon
Telerik team
Share this question
or