TextChanged event not fired

4 posts, 0 answers
  1. Varsha
    Varsha avatar
    1 posts
    Member since:
    Aug 2013

    Posted 03 Jul 2014 Link to this post

    I have below Autocompletebox on a page as below.

    <telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server" Width="400px"
                    DropDownWidth="400px" DropDownHeight="300px" DataTextField="Company_Name"
                    DataValueField="Company_ID"                
                    AutoPostBack="true"
                    InputType="Text"             
                    TextSettings-SelectionMode ="Single"
                    OnTextChanged="RadAutoCompleteBox1_TextChanged">
    </telerik:RadAutoCompleteBox>

    and there is some code written in "RadAutoCompleteBox1_TextChanged", which populates a drop down values based on the selection in autocompletebox.

    I see the filtered entries in the drop down as I type in input control. And it works fine when I select/tab out/ enter a item.
    But if I type exact and whole text that matches the entry, the textchanged event is not fired.

    for example, I have a entry as California in the datasource.
    Typed the whole and exact (case sensitive) text in the input control.
    The entry is displayed in drop down and selected it with mouse.
    TextChanged event is not fired.

    Please help.



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

    Posted 03 Jul 2014 in reply to Varsha Link to this post

    Hi Varsha,

    Such an issue is not expected. This event will fire after selecting the item from the drop down. The provided code is working fine at my end. Please have a look into this help documentation which discuss about the OnTextChanged event.

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. lucia
    lucia avatar
    1 posts
    Member since:
    Dec 2015

    Posted 25 Feb Link to this post

     Hi I've the same problem.I've a RadAutoCompleteBox in  a radgrid edit form. Sometimes the event rdPraticaDettaglioAutoComplete_TextChanged not fires. 
    It's a very strange behaviour because this code works but no every time . 
    I've also tried to bind TextChanged event in grdDettagliTelerik_ItemDataBound event but not works fine.
    Where is the error? 

    Code Client

    <telerik:RadGrid runat="server" id="grdDettagliTelerik" .. >
     ....
    <EditFormSettings EditFormType="Template">
                            <EditColumn UniqueName="EditColumn"></EditColumn>
                            <FormTemplate>
                                <table border="0" width="100%" cellpadding="2">
                                    <tr style="height: auto;" id="trPratica" runat="server" visible="false">
                                        <td style="width: 20%">Pratica</td>
                                        <td style="width: 20%">
                                        
                                            <telerik:RadAutoCompleteBox ID="rdPraticaDettaglioAutoComplete" runat="server"
                                                Width="100%" MaxResultCount="5"
                                                EmptyMessage="Seleziona Pratica" DataValueField="Id"
                                                DataTextField="Id"
                                                MinFilterLength="3"
                                                DataSourceID="objDataCliente"
    OnTextChanged="rdPraticaDettaglioAutoComplete_TextChanged"
                                                OnDataSourceSelect="rdPraticaDettaglioAutoComplete_DataSourceSelect" 
                                                AutoPostBack="true"
                                                AutoCompleteDisplayMember="IdPratica" AutoCompleteValueMember="IdPratica"
                                                InputType="Text" TextSettings-SelectionMode="Single">
                                                <DropDownItemTemplate>
                                                    <table>
                                                        <tr>
                                                            <td>
                                                                <table>
                                                                    <tr>
                                                                        <td>Num.Pratica:
                                                                        </td>
                                                                        <td>
                                                                            <b><%# DataBinder.Eval(Container.DataItem, "Id")%></b>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>C.Cedente:
                                                                        </td>
                                                                        <td>
                                                                            <%# DataBinder.Eval(Container.DataItem, "CodiceCedente")%></>
                                                                        </td>
                                                                    </tr>
                                                                    
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </DropDownItemTemplate>
                                            </telerik:RadAutoCompleteBox>
                                        </td>
    ...
    </EditFormSettings >      
                    </MasterTableView>
                    <ClientSettings EnablePostBackOnRowClick="true" />
                     
                </telerik:RadGrid>



    Code Behind

    protected void rdPraticaDettaglioAutoComplete_TextChanged(object sender, AutoCompleteTextEventArgs e)
            {
                try
                {
                   .....
                }
                catch (Exception ex)
                {
                   
                }

            }

            protected void grdDettagliTelerik_ItemDataBound(object sender, GridItemEventArgs e)
            {
                try
                {

                  
                            RadAutoCompleteBox rdPraticaDettaglioAutoComplete = (RadAutoCompleteBox)item.FindControl("rdPraticaDettaglioAutoComplete");
                            if (rdPraticaDettaglioAutoComplete != null)
                            {
                                rdPraticaDettaglioAutoComplete.DataSource = objDataCliente;

                                rdPraticaDettaglioAutoComplete.TextChanged += rdPraticaDettaglioAutoComplete_TextChanged;
                                 
                                rdPraticaDettaglioAutoComplete.DataSourceSelect += rdPraticaDettaglioAutoComplete_DataSourceSelect;
                                 
                            }

                 }

              catch (Exception ex)
                {
                   
                }

            }
  5. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 29 Feb Link to this post

    Hello Lucia,

    I tried to replicate the described issue, using the provided code snippet and implementation of the RadGrid. I have used the approach that you are subscribing for the TextChanged event of the RadAutoCompleteBox and the event is properly triggered each time the text is changed at my end. Could you be more specific, regarding how exactly to replicate the issue. Do you observe any pattern in the problematic scenario, where the event is not triggered?

    In addition it would be best if you could submit a support ticket, along with a runnable sample attached, where the problem resides, as well as exact steps for replication.

    Regards,
    Nencho
    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