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

Filtering to use both DataTextField and DataValueField

2 Answers 18 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 23 Aug 2019, 02:11 PM

I'm using the RadComboBox to display a list of reports to a user. The reports have and ID and Name which are bound as such DataTextField="Text" DataValueField="ID".

 

The ID of the report is not useful to the end user so we don't want to display the Report ID in the text. However, our site admins and client services people who know the Reports best by ID wish to be able to type the Report ID to filter it this way. 

 

Is it possible to provide such custom filtering? 

 

 

2 Answers, 1 is accepted

Sort by
0
Jason
Top achievements
Rank 1
answered on 23 Aug 2019, 06:21 PM

Managed to resolve this by using an ItemTemplate. It puts both items into the ComboBox item but the report portion is hidden using display: none; css. 

 

<ItemTemplate>
    <span><%# DataBinder.Eval(Container.DataItem, "Text")%></span>
    <span style="display: none;"><%# DataBinder.Eval(Container.DataItem, "ID")%></span>
</ItemTemplate>
0
Peter Milchev
Telerik team
answered on 28 Aug 2019, 09:10 AM

Hello Jason,

For convenience and better visibility from the community, I am sharing other options to achieve filtering on many columns:

1) Using the Load on Demand functionality and filter the events server-side in the OnItemsRequested event. 

Here are some resources related to the suggested approach:

2) Using the MultiColumnComboBox control and its FilterFields functionality: 

Regards,
Peter Milchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ComboBox
Asked by
Jason
Top achievements
Rank 1
Answers by
Jason
Top achievements
Rank 1
Peter Milchev
Telerik team
Share this question
or