Generate the Token from Two Columns

10 posts, 0 answers
  1. George
    George avatar
    13 posts
    Member since:
    Jun 2013

    Posted 20 Jun 2013 Link to this post

    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.
  2. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 25 Jun 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. George
    George avatar
    13 posts
    Member since:
    Jun 2013

    Posted 27 Jun 2013 Link to this post

    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.
  5. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 02 Jul 2013 Link to this post

    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.
  6. George
    George avatar
    13 posts
    Member since:
    Jun 2013

    Posted 27 Feb 2014 Link to this post

    Well, seven months have passed.  Does the current incarnation of the RadAutoCompleteBox include an OnItemDataBound event such that I can implement my design?

    Thanks.
  7. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 04 Mar 2014 Link to this post

    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.
  8. George
    George avatar
    13 posts
    Member since:
    Jun 2013

    Posted 25 Feb 2015 Link to this post

    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.
  9. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 03 Mar 2015 Link to this post

    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.

     
  10. George
    George avatar
    13 posts
    Member since:
    Jun 2013

    Posted 16 Sep 2015 Link to this post

    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.

  11. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 21 Sep 2015 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017