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

TextChanged event not fired

3 Answers 459 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Varsha
Top achievements
Rank 1
Varsha asked on 03 Jul 2014, 11:44 AM
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.



3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Jul 2014, 12:42 PM
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.
0
lucia
Top achievements
Rank 1
answered on 25 Feb 2016, 11:17 AM
 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)
            {
               
            }

        }
0
Nencho
Telerik team
answered on 29 Feb 2016, 02:39 PM
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
Tags
AutoCompleteBox
Asked by
Varsha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
lucia
Top achievements
Rank 1
Nencho
Telerik team
Share this question
or