RadAutoCompleteBox1_EntryAdded doesnt fire

4 posts, 0 answers
  1. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 30 May 2014 Link to this post

    When a user selects an item from the drop down, I want to call a method that gets details from a database for the selected item (using the DataValueField).  I have this code

     protected void RadAutoCompleteBox1_EntryAdded(object sender, AutoCompleteEntryEventArgs e)
            {
                    AutoCompleteBoxEntry entry = e.Entry;
                    
            }

    but it never gets fired, I also have this set

    AutoPostBack="True"

    The dropdown list appears (after typing the first 2 characters)  but I cant trap the selection event, has anyone managed to do this ?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 May 2014 in reply to mww Link to this post

    Hi,

    Such an issue is not expected, please have a look into the sample code snippet which works fine at my end. Please provide your full code if it doesn't help.

    ASPX:
    <telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server" AutoPostBack="true"
        DataSourceID="SqlDataSource1" DataTextField="CountryName" DataValueField="CountryId"
        OnEntryAdded="RadAutoCompleteBox1_EntryAdded">
    </telerik:RadAutoCompleteBox>

    C#:
    protected void RadAutoCompleteBox1_EntryAdded(object sender, Telerik.Web.UI.AutoCompleteEntryEventArgs e)
    {
        AutoCompleteBoxEntry entry = e.Entry;
    }
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 30 May 2014 in reply to Shinu Link to this post

    there is hardly any difference between what you have and my code, but the event wont fire

    <telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox1" Width="290" 
                                  DataTextField="AlternateName" DataValueField="ArtistID" Filter="StartsWith" Skin="WebBlue"
                                  DropDownHeight="300" DropDownWidth="350" InputType="Text" Culture="en-GB" OnDataSourceSelect="RadAutoCompleteBox1_DataSourceSelect" MinFilterLength="2" OnEntryAdded="RadAutoCompleteBox1_EntryAdded" AutoPostBack="True">
                                  <DropDownItemTemplate>
                                       <table cellpadding="0" cellspacing="0">
                                            <tr>
                                                
                                                 <td align="left" style="width: 25%; padding-left: 10px;">

                                                     <asp:Image ID="Image1" runat="server"  Width="60" Height="90" ImageAlign="Left" ImageUrl='<%# DataBinder.Eval(Container.DataItem,"ProfileImage") is DBNull ? null : DataBinder.Eval(Container.DataItem,"ProfileImage")%>' />

                                                 </td>
                                                 <td align="left" style="width: 75%; padding-left: 10px;">
                                                      <%# DataBinder.Eval(Container.DataItem, "AlternateName")%><br /><%# DataBinder.Eval(Container.DataItem, "ArtistType")%><br />
                                                      <%# DataBinder.Eval(Container.DataItem, "ContactAddressCounty")%>
                                                 </td>
                                            </tr>
                                       </table>
                                  </DropDownItemTemplate>
          </telerik:RadAutoCompleteBox>


    protected void RadAutoCompleteBox1_EntryAdded(object sender, AutoCompleteEntryEventArgs e)
            {
                    AutoCompleteBoxEntry entry = e.Entry;
                    
            }













  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 01 Jun 2014 in reply to mww Link to this post

    Hi,

    The EntryAdded event occurs when an entry is added and InputType="Token" is set for RadAutoCompleteBox.  From your code I have noticed that you are setting InputType as Text, please change the InputType to Token which works fine at my end.

    Thanks,
    Shinu.
Back to Top