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

Display Different text

1 Answer 58 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Kurt Kluth
Top achievements
Rank 1
Kurt Kluth asked on 09 Sep 2014, 02:52 PM
I would like to use an AutoCompleteBox to display records as the user enters the information however I need to display alternate text if the record is terminated.  There is the potential that a client name will be listed twice and I need some way of displaying them differently in the AutoCompleteBox.

Normal record will display as such:

Client Name - City, State

What I need for a terminated Client to look like the following

Client Name - City, State (Terminated Date)

I am not sure of how to do this and am looking for some assistance.  Is there away to add an IF...Then statement to my DropDownItemTemplate?

Thanks

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 12 Sep 2014, 01:01 PM
Hello Kurt,

Such functionality could be achieved in a WebService binding scenario, where you could assign a custom attributes to the items, from the datasource. Thus, at the OnClientEntryAdding client-side event, you could set the custom text - Client Name - City, State. In addition, in the same event, you could check if there is already another item with the same text and determine weather to set the Client Name - City, State (Terminated Date) text template.
Bellow you could find a sample project, which I had created for you, demonstrating a possible implementation.


Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
AutoCompleteBox
Asked by
Kurt Kluth
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or