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

Generate the Token from Two Columns

9 Answers 78 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 21 Jun 2013, 02:16 AM
I want the token that is generated to contain both the contain both the text from the DataTextField ('Name') and another column ('Date of Birth').  How can I change the generation process so that it concatenates these two columns?

Examples:

Current Token:    'Hazel, Shelley'

Wanted Token:    'Hazel, Shelley   6/24/79'

I don't want to concatenate the date of birth into the DataTextField because I don't want those characters to be searchable.

Thanks.

BONUS QUESTION:

How can I have the matched part of the DataTextField in the DropDownBox highlighted?

Thanks again.

9 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 25 Jun 2013, 01:23 PM
Hello George,

I would suggest you to set the DataValueField property of the RadAutoCompleteBox to the "Date of Birth" column. At the OnClientEntryAdding, you could access the entry's value and concatenates the Text property. Please consider the following implementation:

<script type="text/javascript">
 
       function OnClientEntryAdding(sender, eventArgs) {
           var entry = eventArgs.get_entry();
           entry.set_text(entry.get_text() + entry.get_value());
       }
       
   </script>



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
George
Top achievements
Rank 1
answered on 27 Jun 2013, 06:10 PM
Thanks Nencho,

However, I am using the DataValueField for the record's ID number.  On PostBack I access the ID to populate the selected person's information throughout the rest of the page.

A thought struck me though - can I access the selected record's DropDown fields during OnClientEntryAdding? 

I use a DropDownItemTemplate as seen below:

                                <DropDownItemTemplate>
                            <table cellpadding="0" cellspacing="0">
                                <tr>
                                    <td style="width: 180px">
                                        <%# DataBinder.Eval(Container.DataItem, "full_name")%>
                                    </td>
                                    <td style="width: 70px; text-align: center">
                                        <%# DataBinder.Eval(Container.DataItem, "date_of_birth", "{0:d}")%>
                                    </td>
                                    <td style="width: 40px; text-align: center">
                                        <%# DataBinder.Eval(Container.DataItem, "sex")%>
                                    </td>
                                    <td style="width: 50px; text-align: center">
                                        <%# ProviderName(DataBinder.Eval(Container.DataItem, "provider_name").ToString())%>
                                    </td>
                                </tr>
                            </table>
                        </DropDownItemTemplate>

Can I pluck the date_of_birth from the DropDown?

Thanks.
0
Nencho
Telerik team
answered on 02 Jul 2013, 12:16 PM
Hello George,

I am afraid that accessing the selected record's DropDown fields is not possible. I will log in the implementation of an OnItemDataBound event for the RadAutoCompleteBox, which would provide you the ability to store the fields from the DataItem in the currently bound entry. Thus at the OnClientEntryAdding, you would be able to access the attribute and alter the entry's text.

In addition, I would suggest you to use a WebService binding if possible. With this approach, you could achieve the above mentioned approach. Please keep in mind, that in a WebService binding scenario, you should use ClientDropDownItemTemplate, instead of the DropDownItemTemplate. Please refer to this online demo, demonstrating the approach of binding.

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
George
Top achievements
Rank 1
answered on 27 Feb 2014, 06:01 PM
Well, seven months have passed.  Does the current incarnation of the RadAutoCompleteBox include an OnItemDataBound event such that I can implement my design?

Thanks.
0
Nencho
Telerik team
answered on 04 Mar 2014, 02:08 PM
Hello George,

I am afraid the feature is not yet implemented. I would suggest you to track the Item in our public portal, in order to trail its process.

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 UI for ASP.NET AJAX, subscribe to the blog feed now.
0
George
Top achievements
Rank 1
answered on 25 Feb 2015, 09:02 PM
Well, it's been another year.  Does the current incarnation of the RadAutoCompleteBox include an OnItemDataBound event such that I can implement my design?

Thanks.
0
Nencho
Telerik team
answered on 03 Mar 2015, 08:22 AM
Hello George,

Indeed the feature is not yet implemented. This is why, I have increased the priority of this feature request, regardless of the comparatively low public interest.

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.

 
0
George
Top achievements
Rank 1
answered on 16 Sep 2015, 05:49 PM

In tracking this feature request, I see that it is 'Approved'.  I left a comment in May asking when I will see it in a quarterly release, but I have yet to hear back.  Nencho, or anyone else, can you give me an update?

 Thanks.

0
Plamen
Telerik team
answered on 21 Sep 2015, 07:49 AM
Hi,

The "Approved" status means that the feature is valid -yet does not set an ETA. I am afraid the feature is not yet implemented. It seem that is was not desired by other customers. Yet I have increased its priority once again.

Regards,
Plamen
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
AutoCompleteBox
Asked by
George
Top achievements
Rank 1
Answers by
Nencho
Telerik team
George
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or